Simulating multiple lower importance levels by actively feeding processes to a low-memory manager

ABSTRACT

Systems and methods are provided for increasing the likelihood that one or more processes in a set of linked processes related to an application will not be terminated while operating in a background state by adjusting importance levels assigned to the processes. In some embodiments, a low importance level may be assigned to a first subset of the set of linked processes associated with a lower priority. A second subset of the set of linked processes associated with a higher priority may be assigned a standard or elevated importance level. In some embodiments, a determination is made regarding whether a process in the first subset of the set of linked processes has been terminated. In response to determining that the process in the first subset has been terminated, a process in the second subset may be reassigned to the first importance level.

BACKGROUND

Electronic computing devices—such as laptop computers, tablets, smartphones, and desktop computer—include operating systems or other softwareapplications that manage resource usage on those devices. Typically, anoperating system application and/or a specialized management module on acomputing device allocates memory resources, processing resources, andvarious other resources to applications operating on the device. Forexample, the operating system may allocate memory resources to anapplication being initiated on the computing device from a pool ofavailable memory resources.

Consumer devices typically include numerous different applications, andmany of these applications are executed simultaneously. As the number ofapplications executing simultaneously on a computing device increases,the memory available to each of these applications decreases due to thephysical limits of the computing device's memory. Eventually, if enoughapplications are running at the same time, the computing device runs outof available memory, resulting in application crashes, slowdowns, lostdata, and various other inconveniences. Thus, managing how a finiteamount of memory is allocated to numerous applications operatingsimultaneously on a computing device remains a challenge for devicemanufacturers.

BRIEF DESCRIPTION OF THE DRAWINGS

The foregoing aspects and many of the attendant advantages will becomemore readily appreciated as the same become better understood byreference to the following detailed description, when taken inconjunction with the accompanying drawings, wherein:

FIG. 1 is a communication system block diagram of a network suitable foruse with some embodiments.

FIG. 2 is a component diagram of an example computing device suitablefor use with various embodiments.

FIG. 3 is a process flow diagram illustrating a computer-implementedmethod for implementing one or more low-memory mitigation processes,according to some embodiments.

FIG. 4 is a process flow diagram illustrating a computer-implementedmethod for assigning a low background importance level to one or moreprocesses of a browser application based on an estimated backgroundmemory threshold, according to some embodiments.

FIG. 5A is a component diagram illustrating an example of memorymanagement of processes operating in a background state.

FIG. 5B is a component diagram illustrating an example of memorymanagement of processes operating in a background state, according tosome embodiments.

FIG. 6 is a process flow diagram illustrating a computer-implementedmethod for adjusting an estimated background memory threshold, accordingto some embodiments.

FIG. 7 is a chart illustrating adjusting an estimated background memorythreshold over time, according to some embodiments.

FIG. 8 is a process flow diagram illustrating a computer-implementedmethod for determining a priority order for a group of processes andassigning importance levels to a group of processes based the determinedpriority order, according to some embodiments.

FIG. 9 is a process flow diagram illustrating a computer-implementedmethod for reassigning importance levels to processes in response todetermining that other processes have been terminated, according to someembodiments.

FIG. 10 is a component diagram illustrating an example of adjustingimportance levels for processes in response to detecting that otherprocesses have been terminated, according to some embodiments.

FIG. 11 is a process flow diagram illustrating a computer-implementedmethod for initiating transfer of process handles of child processesfrom a main process to a stub process, according to some embodiments.

FIG. 12 is a process flow diagram illustrating a computer-implementedmethod for forwarding browser data intended for a stub process operatingon a computing device to a network-based browser application operatingas part of a network browsing service, according to some embodiments.

FIG. 13 is a process flow diagram illustrating a computer-implementedmethod for transferring process handles of child processes from a stubprocess back to a main process, according to some embodiments.

DETAILED DESCRIPTION

Generally described, computing devices allow for multiple applicationsto be substantiated at the same time. However, computing devices onlyhave a finite amount of memory available for use by these applicationsrunning on the computing device. As a result, computing devices can onlysupport a limited number of applications at the same time. In the eventthat memory must be re-allocated or repurposed, the computing device mayneed to forcefully stop some applications, which may cause the computingdevice to experience performance slowdowns, crashes, and other unwantedbehaviors.

Some computing devices include mechanisms for managing the allocationand availability of memory. Specifically, in one embodiment, a computingdevice may implement an operating system or other application thatincludes a low-memory manager component operating on the computingdevice (sometimes referred to as a “low-memory killer”). The low-memorymanager manages memory usage on the computing device in the event thatmemory resources on the computing device are running low. Particularly,the low-memory manager may handle situations in which the computingdevice is running several applications simultaneously. When thecomputing device is running low on memory, the low-memory manager beginsterminating one or more processes. Illustratively, the low-memorymanager categorizes currently instantiated processes into a hierarchy of“importance levels.” The low-memory manager terminates processes inascending order of importance until a sufficient amount of memory hasbeen freed. For processes assigned to the same importance level, thelow-memory manager can utilize additional criteria that may furtherprioritize which process should be terminated. For example, thelow-memory managers can terminate processes that use more memory beforeprocesses that use less memory.

The low-memory manager assigns a process to one of the importance levelsin the hierarchy based on the process's current state ofoperations/activities. For example, processes currently being renderedon the display of the computing device may be considered as operating inthe “foreground” and may be deemed as having the highest importance.Other processes that have been minimized or put on standby (e.g., notcurrently being engaged by the user or otherwise visible to the user)may be assigned to a “background” importance level, which is lower inthe importance hierarchy than the foreground level.

An application being instantiated on a computing device is often made upof a set of linked processes (sometimes also referred throughout thisdescription as “a group” of related processes). In some instances, agroup of processes may be organized such that one or more processesdepend on one or more base processes to continue operating. For example,a process group may include a parent/main process and one or more childprocesses that depend on the parent/main process to operate. Thus, oncea group of processes—such as a set of linked processes related to abrowser application—transitions to the background, the overallimportance level of the group is lowered, putting each of the processesat a higher risk of termination. In some embodiments, the low-memorymanager may simply terminate all the processes having the sameassociated importance level. In other embodiments, the low-memorymanager may begin terminating processes in the group based on othercriteria related to the management of memory. For examples, thelow-memory manager may begin terminating processes in the group based onmemory usage alone. In such examples, the low-memory manager wouldtypically terminate a main process first as the main process usuallyuses the most memory in the group. As a result, each of the childprocesses dependent on the main process would also be terminated.

In overview, aspects of the present disclosure include systems andmethods related to low-memory management strategies. Specifically, aprocessor executing a process management service may implement one ormore low-memory mitigation processes for a group of processes to managethe determination of which processes in a group of processes should beterminated before other processes in the group while operating in thebackground. In such embodiments, the process management service mayadjust the importance levels assigned to one or more of the processes toaffect the likelihood or the order in which a low-memory manageroperating on the computing device terminates the processes. In someembodiments, the process management service may cause a processor toadditionally (or alternatively) replace the main process in the group ofprocesses with a smaller, stub process, such as while the group ofprocesses is operating in the background. By utilizing the stub processrather than the main process, the group of processes may have adecreased likelihood that the low-memory manager terminates the entiregroup of processes, especially while the group of processes operates inthe background.

Generally described, when the group of processes transitions to thebackground, the importance level associated with those processes islowered (e.g., to the “background” importance level). While operating inthe background, the group of processes may have access to a relativelysmaller amount of memory due to their lower importance. As a result, oneor more of the processes in the group may be at a higher risk of beingterminated if they use too much memory. In order to decrease thelikelihood that at least one of the processes in the group will not beterminated in the background, the process management service mayimplement a low-memory mitigation process for the group of processes inpart by assigning importance levels to processes in the group based onan estimated background memory threshold. Specifically, the processmanagement service may select one or more processes in the group suchthat the selected processes are expected to use less than the estimatedthreshold amount of memory. The process management service may thenlower the importance level of other processes in the group that were notselected (sometimes referred to as “non-selected processes”) and may,optionally, increase the importance level of the selected processes. Asa result, in the event that the low-memory manager begins terminatingprocesses, the low-memory manager is more likely to free a sufficientamount of memory by merely terminating one or more of the non-selectedprocesses, thereby decreasing the likelihood that the selected processeswill also be terminated. For example, the process management service mayselect a main process in the group to have a higher importance level,thereby reducing the risk that the main process (and all processesdependent on the main process) will be terminated.

Further, the process management service may determine whether one ormore of the selected processes survived operating in the background.Specifically, in the event that all of the selected processes surviveoperating in the background, the estimated background memory thresholdmay have underrepresented the amount of memory that was actuallyavailable for the group of processes in the background. In response, theprocess management service may increase the estimate of the availablebackground memory the next time the group of processes transitions tothe background. By increasing the estimate, the process managementservice may select more or different processes. However, in the eventthat one or more of the selected processes are terminated in thebackground, the estimated background memory threshold may haveoverrepresented the amount of memory that was actually available for thegroup of processes in the background. In response, the processmanagement service may use a lower background memory threshold the nexttime the group of processes transitions to the background. At that time,the process management service may be able to select fewer processes ora different combination of processes.

In some embodiments, the process management service may implement alow-memory mitigation process for a group of related processes bydynamically adjusting the importance level of processes in the group,such as while the group of processes is operating in the background. Insuch embodiments, the process management service may determine apriority order for the processes in the group, assign one or morelow-priority processes to a low importance level, and assign theremaining processes to a standard importance level. In some embodiments,the process management service may extend the range of importance levelsavailable for use with the group of process, for instance, by raisingthe importance level of one or more processes in the group to anelevated importance level to which the group of processes may notordinarily have access. The process management service may monitorprocesses assigned to comparatively lower importance levels to determinewhether those processes have been or are likely to be terminated. In theevent that no processes assigned to the lower-importance level areterminated, there may be sufficient memory on the computing device forall applications. In such cases, the process management service may notneed to modify the importance levels of any of the processes in thegroup. However, if one or more processes assigned to thelower-importance level are terminated, there may be low or insufficientmemory for more important applications operating on the computingdevice. As a result, the process management service may reassign otherprocesses in the group to a lower importance level to replace processesthat were terminated. Thus, the processes management service maydecrease the likelihood that higher-priority processes will beterminated by ensuring that the low-memory manager terminateslower-priority processes before higher-priority processes, if thecomputing device continues to experience low memory.

In some embodiments, the process management service may implement alow-memory mitigation process for a group of processes by replacing themain process in the group with a stub process as noted above. The stubprocess may have no or limited functionality and may requiresubstantially less memory than the main process. The process managementservice may transfer the process handles and other identifyinginformation needed to maintain the child processes from the main processto the stub process. Subsequent to transferring the process handles tothe stub process, the process management service may terminate the mainprocess. As the stub process uses less memory than the main memory, thestub process may have a low likelihood of being terminated relative tothe likelihood that the main process would have been terminated. As aresult, there is an overall lower likelihood that the entire group ofprocesses will be terminated as a group. Further, once the group ofprocesses transitions out of the background (e.g., back into theforeground), the group of processes may be assigned to higher importancelevels and, thus, may be less likely to be terminated. As a result, theprocess management service may restart the main process, transferprocess handles of the child processes back to the main process, andterminate the stub process.

In various embodiments, the process management service may prioritizethe group of related processes based on various factors that may renderone or more processes more important or “valuable” than other processes.These factors may reflect various conditions or properties of thecomputing device, as well as the processes themselves. As such, invarious embodiments described herein, references to a “higher-priority”or a “lower-priority” process may reflect a determination regarding thecost and other value of the process relative to other processes in thegroup of processes.

In one example, the relative priority of a process in the group may bebased at least in part on considerations regarding the “cost” or “costs”of replacing the process in the event the process is terminated. Thecosts of replacing a process may include, among other factors, anexpected amount of time to replace the process (e.g., an expected amountof time needed to retrieve resources for the process from a network), anexpected amount of processing power to replace the process, an estimatedamount of battery power needed to replace the process, and otherresources that may be expended on the computing device to restart theprocess. Other costs may include monetary costs to request and receiveresources from the network that are needed to replace the terminatedprocess, such as the monetary costs of network communications given adata plan associated with the computing device (e.g., a 4G data planwith monthly data caps or communications while in a roaming network).

In some embodiments, a cost of replacing a process may also include anestimate of the amount of “phantom” memory that may also be requiredwhen replacing the process. In an example, a cost of replacing a processmay include the amount of memory resources needed to run the process, aswell as an amount of “phantom” memory used by another process (e.g., anOpenGL driver) that may not be used by the process but may nonethelessbe required for the process to execute as expected. In such embodiments,the cost of replacing a process may factor in this amount of “phantom”memory used by another process.

Additionally (or alternatively), costs may include a calculation ordetermination related to an amount of resources needed to replace theprocess that may be acquired from a local cache. In such embodiments,fewer processing or network resources may be required to replace aprocess in the event that some or most of the process's resources (e.g.,related images, stored data, etc.) are available in the local cache. Onthe other hand, replacing a process with resources obtained from sourcesother than a local cache (e.g., from a content provider over a network)may be associated with a higher cost as it may take more power,processing, and networking resources to obtain these resources.

In some embodiments, a cost of replacing a process may also oralternative reflect a cost of replacing processes that are dependent onthe process to be replaced. Specifically, a total cost for replacing aprocess may include the costs of replacing the process itself, as wellas any dependent processes that may also be terminated as a result.Examples of dependent processes may include a nested page inside of aniframe of a web page running in a browser application.

In some embodiments, the cost of replacing a process may include anamount of time required to serialize or store data associated with theprocess. As such, processes that may require a longer amount of time maybe associated with a higher priority to enable those processes more timeto store or serialize their data before being terminated.

Further, in determining a relatively priority of a process, the processmanagement service may also (or alternatively) consider the impact ofrestarting the process on the user. For instance, a process associatedwith user profile data or other user data that may be difficult toreplace without user intervention (e.g., form input data, cookie orother stateful information, game state information, etc.) may beparticularly “costly” to replace as restarting the process may requirethe user to reenter data or other information. In an example, a processrelated to a page running in a browser application may be associatedwith a higher cost to replace to the user when the page was loaded inresponse to the user's submitting a form because the user may need toprovide authorization to resubmit the form. In another, non-limitingexample, a process related to a page running in a browser applicationmay be relatively more costly to replace to the user in the event thatthe user has interacted with the page to a considerable degree—such aswhen playing a game—as measured by the number of input events related tothe page versus an amount of time that the page has been visible. Inanother example, the computing device may receive a user inputdesignating a certain application or process as a “favorite” applicationor process that the user may not want terminated, and this process maybe associated with a higher cost than in the even the process were not a“favorite” process. In yet another example, a process associated with apage running in a browser application may be relatively more costly toreplace with regard to the user when that page has been modified oramended using dynamic requests, such as one or more asynchronousrequests for more content (e.g., AJAX requests).

As such, the relative costs of losing data particularly relevant to,used by, or useful to a customer may outweigh other costs, such as thetime and resources needed to reload the process on the computing device.In some instances, these costs to the user may be inferred based on theuser's use of the application, for example, by monitoring for processesthat are associated with user input, process associated with frequentuser interaction (e.g., frequent refreshes or reloading of a browsertab), etc. As such, the process management service may, in suchembodiments, prioritize processes with high replacement costs relativeto the user above processes with high replacement costs relative to thecomputing device.

For ease of description, each low-memory mitigation process (such asthose described above) is primarily described in separate embodiments toemphasize certain details regarding each strategy. However, thelow-memory mitigation processes are not mutually exclusive, and theprocess management service may implement two or more low-memorymitigation processes for a group of processes in concert to improve theoverall likelihood that one or more of the processes in the group willnot be terminated, for example, while operating in the background. Assuch, in embodiments in which the process management service implementstwo or more low-memory mitigation processes, the implementations ofthose low-memory mitigation processes may occur simultaneously,consecutively, or in any order that would be apparent to one of ordinaryskill in the art.

The various embodiments will be described in detail with reference tothe accompanying drawings. Wherever possible, the same reference numberswill be used throughout the drawings to refer to the same or like parts.References made to the particular examples and implementations are forillustrative purposes, and are not intended to limit the scope of theinvention or the claims.

FIG. 1 is a functional block diagram of an illustrative system 100suitable for implementing some aspects of the present disclosure. Thesystem 100 may include a computing device 102 a and may include one ormore optional computing devices 102 b, which may be similar to ordifferent from the computing device 102 a. The computing device 102 aand the one or more optional computing devices 102 b may eachcommunicate with a server 118 by exchanging data and other informationvia one or more networks, such as the network 114. Those skilled in theart will recognize that the computing devices 102 a, 102 b may be any ofa number of computing devices that are capable of communicating over anetwork including, but not limited to, a laptop, personal computer,personal digital assistant (PDA), hybrid PDA/mobile phone, mobile phone,smartphone, wearable computing device, electronic book reader, digitalmedia player, tablet computer, gaming console or controller, kiosk,augmented reality device, other wireless device, set-top or othertelevision box, and the like.

In the example illustrated in FIG. 1, the computing device 102 a may bedirectly connected to the network 114 via a wired connection 110 or maybe in communication with a base station 106 via a wireless or cellularconnection 108. The base station 106 may, in turn, be in communicationwith the network 114 via a wired connection 111. Similarly, the one ormore optional computing devices 102 b may be in communication with thenetwork 114 via a wired connection 112 and/or may be in communicationwith the base station 106 via a wireless or cellular connection 104. Thenetwork 114 may exchange data and information between the server 118 andcomputing device 102 a (and/or the optional computing devices 102) via awired connection 116.

The network 114 may be any wired network, wireless network, orcombination thereof. In addition, the network 114 may be a personal areanetwork, local area network, wide area network, cable network, satellitenetwork, cellular telephone network, etc. or combination thereof. Inaddition, the network 114 may be a personal area network, local areanetwork, wide area network, over-the-air broadcast network (e.g., forradio or television), cable network, satellite network, cellulartelephone network, or combination thereof. For example, the network 114may be a publicly accessible network of linked networks, possiblyoperated by various distinct parties, such as the Internet. In someembodiments, the network 114 may be private or semi-private networks,such as a corporate or university intranets. The network 114 may includeone or more wireless networks, such as a Global System for MobileCommunications (GSM) network, a Code Division Multiple Access (CDMA)network, a Long Term Evolution (LTE) network, or some other type ofwireless network. The network 114 may use protocols and components forcommunicating via the Internet or any of the other aforementioned typesof networks. Protocols and components for communicating via the Internetor any of the other aforementioned types of communication networks arewell known to those skilled in the art and, thus, are not described inmore detail herein.

In some embodiments, the server 118 may include a network browserservice 120, which may work in concert with a browser applicationoperating on the computing devices 102 a, 102 b (e.g., a browserapplication 218 operating on the computing device 102 a as describedwith reference to FIG. 2) to perform various supplemental functions,such as analyzing aggregate web traffic patterns received from thecomputing devices 102 a, 102 b, preprocessing web pages for rendering onthe computing devices 102 a, 102 b, and applying predictive algorithmsto quickly deliver content to the computing devices 102 a, 102 b. Theseand other functions may be implemented by a processing unit 122 includedin the network browser service 120 that is configured to execute anetwork browser application 126. The network browser service 120 mayalso include a network interface component 124 for receiving browserdata from and sending browser data to the computing devices 102 a, 102 bover the network 114.

In some embodiments, the network browser service 120 may be implementedby one or more virtual machines implemented in a hosted computingenvironment. The hosted computing environment may include one or morerapidly provisioned and/or released computing resources. The computingresources may include hardware computing, networking and/or storagedevices configured with specifically configured computer-executableinstructions. A hosted computing environment may also be referred to asa “cloud” computing environment.

The network browser service 120 may receive information regardinglow-memory mitigation processes that have been implemented on variouscomputing devices, such as the computing devices 102 a, 102 b. Forexample, the network browser service 120 may collect informationregarding the identities of groups of processes operating on thecomputing devices 102 a, 102 b at the time the survival strategies wereimplemented, the results of implementing the strategies (e.g., whetherprocesses in those groups were terminated or survived), the batterylevel at the time of implementation of the strategies, identities ofother applications running at the same time, and various otherinformation regarding the circumstances and contexts in which thelow-memory mitigation processes were implemented on those devices. Thenetwork browser service 120 may analyze this “crowd-sourced” informationto identify situations in which the implementation of low-memorymitigation processes proved to be more or less successful. For example,the network browser service 120 may determine that utilizing a certainbackground memory threshold is more likely to prevent unwanted processterminations on computing devices having a certain combination ofapplications, capabilities, capacities, components, etc. (e.g., acertain maximum available memory).

The network browser service 120 may store raw or processed dataregarding the implementation of various low-memory mitigation processesas a corpus of data in a data store 128 and may make some or all of thisdata available to the computing devices 102 a, 102 b. Particularly, insome embodiments, the network browser service 120 may provide thecrowd-sourced information to the computing devices 102 a, 102 b (e.g.,in response to a request received from the computing devices 102 a, 102b), and the computing devices 102 a, 102 b may utilize the receivedinformation in order to implement one or more low-memory mitigationprocesses. For example, the computing device 102 a may send informationabout its current configuration and the processes currently operating onthe computing device 102 a to the network browser service 120, and inresponse, the network browser service 120 may send information to thecomputing device 102 a regarding particular low-memory mitigationprocesses that have been successfully implemented on other computingdevices with similar configurations.

FIG. 2 depicts a general architecture of a computing device 102 aconfigured to implement one or more low-memory mitigation processes,according to various embodiments. The general architecture of thecomputing device 102 a depicted in FIG. 2 includes an arrangement ofcomputer hardware and software components that may be used to implementaspects of the present disclosure. The computing device 102 a mayinclude many more (or fewer) elements than those shown in FIG. 2. It isnot necessary, however, that all of these generally conventionalelements be shown in order to provide an enabling disclosure. Asillustrated, the computing device 102 a includes a processing unit 204,a network interface 206, a computer readable medium drive 208, aninput/output device interface 210, an optional display 220, and anoptional input device 222, all of which may communicate with one anotherby way of a communication bus. The network interface 206 may provideconnectivity to one or more networks or computing systems. For example,the processing unit 204 may receive and/or send information andinstructions from/to other computing systems or services via one or morenetworks (e.g., a network 114 as described with reference to FIG. 1).The processing unit 204 may also communicate to and from a memory 212and may further provide output information for the optional display 220via the input/output device interface 210. The input/output deviceinterface 210 may also accept input from the optional input device 222,such as a keyboard, mouse, digital pen, microphone, touch screen,gesture recognition system, voice recognition system, image recognitionthrough an imaging device (which may capture eye, hand, head, bodytracking data and/or placement), gamepad, accelerometer, gyroscope, orother input device known in the art.

The memory 212 may include computer- or processor-executableinstructions (grouped as modules or components in some embodiments) thatthe processing unit 204 may execute in order to implement one or moreembodiments. The memory 212 may generally include random-access memory(“RAM”), read-only memory (“ROM”), and/or other persistent, auxiliary,or non-transitory computer-readable media. The memory 212 may store anoperating system 216 that provides computer program instructions for useby the processing unit 204 in the general administration and operationof the computing device 102 a. The memory 212 may further includecomputer program instructions and other information for implementingaspects of the present disclosure. For example, in some embodiments, thememory 212 may include a user interface module 214 that generates userinterfaces (and/or instructions therefor) for display upon the computingdevice 102 a (e.g., on the optional display 220). In addition, thememory 212 may communicate with an external data storage unit 224.

In some embodiments, the memory 212 may include a browser application218, a low-memory manager 219, and a process management service 221,each of which may be executed by the processing unit 204 to performoperations according to various embodiments. While the low-memorymanager 219 is illustrated in FIG. 2 as a separate module stored in thememory 212, in some embodiments, the low-memory manager 219 may beincluded and/or implemented in the operating system 216, and as such, aseparate memory manager 219 may not be required to implement variousembodiments. Further, for ease of description, various embodimentsdescribed herein refer to the browser application 218. However, variousembodiments may be implemented with various applications, including, butnot limited to, the browser application 218.

In some embodiments, the processing unit 204 may execute the browserapplication 218, and during execution, the browser application 218 mayfunction or otherwise be associated with a group of processes. The groupof processes may include a main process and one or more child processesthat depend on the main process to function. In particular, the mainprocess may generally manage the operations of the browser application218, such as by handling resource requests to a resource server, drawingpages to the display, etc. A child process, in some examples, maycorrespond with a tab of the browser, such that each tab that is open inthe browser may be associated with a distinct child process. Asdescribed above, the main process maintains handles and bindinginformation used to identify and utilize each child process. In someembodiments, the child processes may be terminated in response to thetermination of the main process because the binding information for thechild processes is lost when the main process is terminated.Additionally, the main process of the browsing application 218 mayrequire a comparatively larger amount of memory to operate than childprocesses to facilitate its comparatively larger number of functions,state information, etc.

The memory 214 may include one or more pools of memory made available tothe browser application 218, as well as various other applications ormodules stored in the memory 212 and executed on the computing device102 a. For example, such a pool of available memory may includeabstracted memory 213. The abstracted memory 213 may support the memoryneeds of the browser application 218 and one or more other applicationsoperating on the computing device 102. As a result, the browserapplication 218 and the one or more applications (not shown) may havenontrivial memory interdependencies such that each application mayperform cross memory consumption of the abstract memory 213, which maybe a finite memory resource. In such embodiments, it may be impossiblefor the browser application 218, the operating system 216, or anotherapplication to determine or estimate an amount of memory in theabstracted memory 213 (or in the memory 212, generally) that iscurrently available for use with any practical accuracy. Thus, nocomponent operating on the computing device 102 a may be unable toreliably determine (or estimate) an amount of memory that is availablethe computing device 102 a. As a result, the process management service221, the operating system 216, and other components of the computingdevice 102 a may be unable to anticipate at any given time how muchmemory is associated with a process or how much memory can be freed byterminating that process.

In light of the uncertainty regarding memory that is available on thecomputing device 102, the processing unit 204 may execute the processmanagement service 221 to implement one or more low-memory mitigationprocesses for a group of processes. In particular, the processmanagement service 221 may estimate and implement a background memorythreshold for a group of processes related to the browser application218, and the process management service 221 may assign importance levelto particular services based on the estimated background memorythreshold (e.g., as described with reference to FIGS. 4-7). In someembodiments, the process management service 221 may dynamically adjustpriorities of processes in a group of processes operating in thebackground in order to influence the order in which the memory manager219 terminates those processes such that higher-priority processes inthe group have a lower likelihood of being terminated (e.g., asdescribed with reference to FIGS. 8-10). Additionally (oralternatively), the process management service 221 may temporarilyreplace a main process in the group of processes with a stub processhaving a comparatively smaller memory requirement in order to reduce thelikelihood that the memory manager 219 will terminate the entire groupof processes in the background (e.g., as described with reference toFIGS. 11-13. In various embodiments, the process management service 221may adjust or assign an importance level to a process by modifyingservice bindings maintained by the operating system 216 or by utilizingother system-level calls/functions.

While the process management service 221 is illustrated as a distinctmodule in the memory 212, in some embodiments, the process managementservice 221 may be incorporated as a module in the browser application218 or another application, and as such, a separate memory manager 219may not be required to implement various embodiments. In embodiments inwhich the process management service 221 is implemented as a modulewithin the browser application 218, the process management service 221may be able to determine the memory usage of processes related to thebrowser application 218, but may be unable to determine memory used byother applications, as noted above. In such embodiments, the processmanagement service 221 may estimate the amount of memory that isactually available on the computing device 102 a for use in implementingvarious low-memory mitigation processes for a group of processes, asfurther described below.

Further, in some embodiments, the above description of the computingdevice 102 a may also be applied to various other computing devices,such as the one or more optional computing devices 102 b. In suchembodiments, the one or more computing devices 102 b may include thecomponents discussed above and may be configured to perform operationsdescribed with reference to the various embodiments.

FIG. 3 is a process flow diagram of an illustrative routine 300 forimplementing one or more low-memory mitigation processes for a set oflinked processes or a group of related processes with a processmanagement service to decrease the likelihood that one or more processesin the group will be terminated, such as while operating in thebackground, according to various embodiments. In some embodiments, theroutine 300 may be implemented by a processor executing a processmanagement service on a computing device (e.g., the process managementservice 221 of the computing device 102 a as described with reference toFIG. 2).

With reference to FIG. 3, the process management service 221 maydetermine that an application associated with a group of processes istransitioning (or is about to transition) to the background state atblock 302, such as by receiving an indication from an operating systemapplication running on the computing device. In some embodiments, theapplication may transition to the background state in response to a userinput that minimizes, hides, or otherwise takes focus away from theapplication. For example, the operating system 216 may send the browserapplication 218 to the background in response to receiving a user inputthat starts another application that is brought to the foreground.

When the application is moved to the background, the importance level ofeach process in the group is lowered (e.g., to the “background”importance level). In the background, the main process is often thefirst process terminated in the group of processes due to the relativelylarge amount of memory that the main process utilizes. However, when themain process is terminated, the child processes are also terminatedbecause the main process manages the child processes' bindings, handles,and other identifiers needed for those child processes to continueoperating. Further, even in the event that the entire group of processesis not terminated together, the low-memory manager may not consider therelative priority of each process in the group, and thus may beginterminating processes in the group based merely on their respectivememory usage. Thus, to decrease the likelihood that one or morehigher-priority processes in the group are terminated in the background,the process management service may implement one or more low-memorymitigation processes for the group of processes, at block 304. In someembodiments, the process management service 221 may change theimportance level associated with one or more of these processes toaffect the order in which the processes in the group are terminated bythe low-memory manager 219. Specifically, in the event that thelow-memory manager 219 needs to free memory, the process managementservice 221 may lower the importance of one or more processes in thegroup that have the lowest priorities in the group, thereby causing thelow-memory manager 219 to terminate those lower-priority processesbefore other processes in the group, if necessary.

In some embodiments, at block 304, the process management service 221may estimate a background memory threshold, which may correspond with anestimate of a maximum amount of memory that the group of processes mayutilize while operating in the background. In view of this estimatedbackground memory threshold, the process management service 221 mayselect one or more processes in the group such that the one or moreselected processes will utilize an amount of memory that does not exceedthe estimated background memory threshold while operating in thebackground. The process management service 221 may then lower theimportance level of other processes in the group that were not selected(and/or raise the importance level of the selected processes), therebycausing the low-memory manager 219 to terminate those non-selectedprocesses before the selected processes in the event that more memory isneeded on the computing device. By prioritizing processes in the groupbased on the estimated background memory threshold, the processmanagement service 221 may decrease the likelihood that higher priorityprocesses (e.g., the main process or child processes associated withtabs that are storing hard-to-replace user input data) will beterminated in the background because the low-memory manager 219 may beable to free a sufficient amount of memory merely by terminating one ormore of the non-selected processes. Estimating a background memorythreshold and using that threshold to adjust the importance level ofprocesses in the group is further described with reference to FIG. 4.

In some additional (or alternative) embodiments, at block 304, theprocess management service 221 may adjust the importance level ofprocesses in the group while operating in the background in order tocontrol the order in which the processes in the group are terminated. Insuch embodiments, the process management service 221 may determine apriority order for the processes in the group, assign one or morelow-priority processes to a low importance level, and assign theremaining processes to a standard importance level. For example, thelowest priority processes may be assigned to the “cached” importancelevel, while the remaining processes may remain in the standard/default“background” importance level, which is higher in the importancehierarchy than the cached importance level. In some embodiments, theprocess management service 221 may also assign one or more high-priorityprocesses (e.g., the main process) to an elevated importance level—suchas a service or visible importance level—that is higher in theimportance hierarchy than the background importance level and the cachedimportance level. In some instances, the elevated importance level maynot be an importance level that would be available to the group ofprocesses, and as such, the process management service 221 may expandthe overall number of importance levels to which process in the groupmay be assigned. By assigning importance levels to the processes in thegroup based on their respective priority levels, the process managementservice 221 may indirectly set the order in which the low-memory manager219 will terminate processes. As such, higher-priority processes in thegroup may have a decreased likelihood of being terminated as thelow-memory manager 219 may be able to free a sufficient amount of memoryby terminating lower-priority processes. Determining a priority orderfor the processes and the groups and assigning the processes importancelevels based on their respective priorities is described further withreference to FIG. 8.

In some embodiments of the operations performed at block 304, theprocess management service 221 may replace the main process in the groupwith a stub process. As noted above, the main process may require acomparatively large amount of memory, and as a result, the main processmay be a prime target for the low-memory manager 219 to terminate in theevent that available memory resources on the computing device are low.However, as also described, terminating the main process may result intermination of child processes dependent on the main process. Todecrease the likelihood that the whole group of processes is terminatedas a result of the low-memory manager 219's termination of the mainprocess, the process management service 221 may replace the main processwith a light-weight, stub process. The stub process may have no orlimited functionality and may require substantially less memory than themain process. The process management service 221 may transfer processhandles for maintaining the child processes from the main process to thestub process and may terminate the main process after the transfer iscomplete. As the stub process uses less memory, the stub process mayhave a low likelihood of being terminated, relative to the likelihoodthat the main process would have been terminated. Replacing/substitutinga main process with a stub process as part of implementing a low-memorymitigation process is described further with reference to FIG. 11.

At decision block 306, the process management service 221 determineswhether the application is operating (or still operating) in thebackground. Specifically, while the group of processes operates in thebackground, the processes may have an overall higher likelihood of beingterminated because the processes are associated with a lower importancelevel while in the background. Thus, in response to determining that theapplication is operating (or still operating) in the background (i.e.,decision block 306=“YES”), the process management service 221 mayoptionally continue implementing the one or more low-memory mitigationprocesses in optional block 310 in order to continue decreasing (ormaintaining) the likelihood that at least one process in the group willnot be terminated while operating in the background.

In some embodiments in which the process management service 221 hasassigned importance levels to processes in the group as part ofimplementing one or more low-survival strategies at block 304 (e.g., asdescribed with reference to FIG. 8), the low process management service221 may continue implementing such low-memory mitigation processes inoptional block 310 by continuing to adjust the importance levels of theprocesses in response to determining that one or more of those processeshas been terminated. Specifically, the process management service 221may monitor processes assigned to comparatively lower importance levelsto determine whether those processes have been or are likely to beterminated. In response to determining that one or more processesassigned to lower priorities level(s) have been or will be terminated,the process management service 221 may reassign other processes in thegroup to a lower importance level, thereby increasing the likelihoodthat the low-memory manager 219 will not need to terminate thehigher-priority processes in the group. This process of dynamically“feeding” the low-memory manager 219 with low-priority process topreserve higher-priority processes is further described with referenceto FIG. 9.

Additionally (or alternatively), in embodiments in which the processmanagement service 221 has replaced a main process with a stub processas part of implementing a low-memory mitigation process at block 304,the stub process may be configured with limited or no functionality.Thus, while the group of processes is operating in the background, theprocess management service 221 may continue implementing this low-memorymitigation process in optional block 310 by forwarding data and otherinformation intended for the stub process to a network-based browserapplication (e.g., the network browser application 126 of the networkbrowser service 120 as described with reference to FIG. 1). Byforwarding the data to the network-based browser application forprocessing, the process management service 221 may offload some of theresponsibilities of the stub process that would have ordinarily beenhandled by the main process to the network-based browser application,thereby enabling the browser application 218 on the computing device tohave some of the functionality of having the main process without havingto support the main process's comparatively large memory needs.Forwarding data intended for the stub process is described further withreference to FIG. 12.

In some embodiments of the operations performed at optional block 310,the process management service 221 may continually adjust the importancelevels of the processes in the group based on changes to their relativepriorities. For example, the process management service 221 mayinitially determine that a process has a low priority and may assign theprocess to a low importance level. However, subsequent to assigning thelow importance level to that process, the process management service 221may determine that the priority of the process has increased (e.g., theprocess is now associated with user profile data or otherhard-to-replace information), and as a result, the process managementservice 221 may determine another priority order of the group ofprocesses based on the updated priority information and may adjust theimportance levels of the processes to reflect the updated priorityorder. In an example, the process management service 221 may determinethat a process will require a comparatively longer amount of time tostore or serialize its data and thus may associate the process with ahigher priority and importance level because the process may be unableto complete serializing or storing its data before being terminated ifthat process were assigning to a low importance level. However, oncethat process has stored or serialized its information, the processmanagement service 221 may lower its priority as its data may be easilyrestored and may reassign the process to a lower importance level (andoptionally may increase the importance level of another process that nowhas a comparatively higher priority).

Returning to decision block 306, in response to determining that theapplication is not operating (or no longer operating) in the background(i.e., decision block 306=“NO”), the process management service 221 mayoptionally adjust the low-memory mitigation process (or strategies)implemented at block 304 based at least in part on the operationalstatus of at least one process in the group of process, in optionalblock 308. Specifically, the process management service 221 may evaluatewhether the strategy implemented at block 304 was successful atpreventing the termination of one or more processes in the group or atleast successful at preventing the termination of relativelyhigher-priority processes (e.g., described with reference to FIG. 6).For example, the process management service 221 may determine that theestimated background memory threshold utilized to assign importancelevels to processes in the group led to the termination of all of theprocesses in the group. In this example, the processes managementservice may lower the estimated background memory threshold as thecurrent estimate overestimated the actual amount of memory that wasavailable for the group of processes in the background.

In some embodiments of the operations of block 308, the processmanagement service 221 may periodically adjust the low-memory mitigationprocesses. For instance, in the above example, the process managementservice 221 may periodically increase or decrease the estimatedbackground memory threshold to determine whether the amount of actualmemory available to the processes has changed

In optional block 312, the process management service 221 may resumenormal application operations by rolling back changes made to the groupof processes implemented as part of a low-memory mitigation process atblock 304. For example (as further described with reference to FIG. 13),in optional block 312, the process management service 221 may restartthe main process, transfer process handles of the child processes fromthe stub process to the main process, and terminate the stub process inresponse to creating a stub process.

The process management service 221 may continue performing the routine300 by again determining that an application associated with a group ofprocesses is transitioning (or about to transition to) the background atblock 302. As such, the operations of the routine 300 may be performedin a loop any number of times.

FIG. 4 is a process flow diagram of an illustrative subroutine 400 forestimating a background memory threshold and assigning one or moreprocesses in a group of processes to importance levels based on theestimated background memory threshold, according to some embodiments.Subroutine 400 may be implemented with a process management serviceoperating on a computing device (e.g., the process management service221 of the computing device 102 a as described with reference to FIG.2). The subroutine 400 implements an embodiment of the operations ofblock 304 of the routine 300 as described with reference to FIG. 3.

In optional block 402, the process management service 221 may substitutea main process of the group of processes with a stub process to avoidlosing the entire group of processes if the main process is terminated,as further described below with reference to FIG. 11. In someembodiments, the process management service 221 may initiate thecreation of the stub process, such as making a process start call to theoperating system 216.

In optional block 404, the process management service 221 may obtaininformation regarding background memory thresholds utilized on computingdevices having configurations, capabilities, or installed applicationssimilar to those of the computing device on which the process managementservice 221 is operating. In such embodiments, the process managementservice 221 may receive the information via a network interface (e.g.,the network interface 206), which may in turn receive the informationfrom a server in communication with numerous computing devices (e.g.,the network browser service 120 of the server 118 as described withreference to FIG. 2). In some embodiments, updated information regardingbackground memory thresholds may be periodically received from theserver 118, and the process management service 221 may obtain the latestor most up-to-date information while performing operations at optionalblock 404. In some other embodiments, the information may have beendirectly loaded into the memory 212 of the computing device 102 a (e.g.,by an original equipment manufacturer).

At block 406, the process management service 221 estimates a backgroundmemory threshold. In some embodiments, the process management service221 may estimate the background memory threshold based at least in parton resources that the service can currently monitor reliably, such asinternal compositor memory usage and count/types of resources related toeach process.

In some embodiments of the operations performed at block 406, theprocess management service 221 may estimate the background memorythreshold without using information regarding an amount of memory thatis available on the computing device 102 a. In some instances,estimating the background memory threshold without using informationregarding an amount of memory may include estimating the backgroundmemory threshold without receiving such information. In some otherinstances, estimating the background memory threshold without usinginformation regarding an amount of memory may include receiving andignoring memory regarding an amount of memory on the computing device.As described above, due to the non-trivial memory interdependencies ofprocesses and applications operating on the computing device 102 a, theprocess management service 221 and other components on the computingdevice 102 a (e.g., the operating system 216) may be unable todetermine, contemporaneously, an amount of memory that is actuallyavailable on the computing device 102 a or how much memory may be freedby terminating a process or application. As a result, the processmanagement service 221 may not have access to the amount of memoryutilized by other applications operating on the computing device andthus may estimate the background memory threshold based only on thememory usage of the group of processes. Thus, in an example, the processmanagement service 221 may initially estimate the background memoryusage as half of the total memory utilized by the group of processes. Insome embodiments, the process management service 221 may receiveinformation regarding an amount of memory available on the computingdevice, such as from the operating system 216. However, as noted above,the information received from the operating system 216 may be inaccurateas no component on the computing device 102 a may be able to accuratelydetermine the memory available on computing device 102 a, and in suchinstances, the process management service 221 may discard or ignore theinformation received from the operating system 216.

In embodiments in which the process management service 221 receivesinformation from the server in optional block 404, the processmanagement service 221 may also (or alternatively) estimate thebackground memory threshold at block 406 at least in part based on thereceived information. For example, the information received from theserver may indicate that similarly configured computing devicessuccessfully avoided termination of certain processes based on aparticular value of the estimated background memory threshold.

At block 408, the process management service 221 selects at least one ofthe group of processes that does not exceed the estimated backgroundmemory threshold. In particular, the process management service 221 maydetermine or estimate a memory usage for each of the group of processesand may select a subset of the group of processes such that a totalestimated memory usage for the subset of selected processes does notexceed the background memory threshold estimated at block 406. In theabove example, the process management service 221 may select a subset ofprocesses such that the total memory usage of the subset of process doesnot exceed half of the total memory usage of the group of processes.

In some embodiments, the process management service 221 may determine apriority order for the one or more processes based on various criteriarelated to a relative priority of each of the processes. For example,the process management service 221 may identify the processes of thebrowser application 218 most likely to be important to the user, such asthe processes associated with tabs or loaded pages storing user input(which, if lost, would require the user to re-input that data),processes that were recently used by the user, etc. The processmanagement service 221 may additionally (or alternatively) determine anoverall “cost” of replacing the processes and may derive the processes'relative importance based on each process's associated cost ofreplacement. In such embodiments, by determining the cost ofreplacement, the process management service 221 may identify thoseprocesses in the group of processes that require comparatively moreresources to replace in the event that the low-memory manager 219terminates those processes in the background. As such, the processmanagement service 221 may attempt to decrease the likelihood that thelow-memory manager 219 will terminate these “more costly” services, asfurther discussed herein.

At block 410, the process management service 221 assigns a low (orlower) background importance level to each of the group of processesthat were not selected at block 408, thereby decreasing the likelihoodthat the low-memory manager 219 will terminate the selected processes.For example, in the event that the low-memory manager 219 needs to freememory for applications operating in the foreground, the low-memorymanager 219 will begin terminating the processes that were not selectedbefore terminating the processes in the subset selected at block 408.Thus, the selected processes may continue operating on occasions inwhich the low-memory manager 219 is able to free a sufficient amount ofmemory by merely terminating one or more non-selected processes.Further, in some embodiments in which the low-memory manager terminates(or causes termination of) every process in an importance levelsimultaneously, the process management service 221 may lower the overallrisk that the processes that were selected (e.g., higher priorityprocesses) will be terminated because the low-memory manager 219 mayterminate all of the (or multiple) processes that were not selected andthat were assigned to the lower importance level without needing toterminate the processes that were selected.

In some embodiments of the operations performed at blocks 406, 408, theprocess management service 221 may adjust the estimate of the backgroundmemory threshold based on the power level of the computing device.Replacing/reloading processes in the group may require a considerableamount of battery power. Thus, the process management service 221 mayartificially lower the estimated background memory threshold, which mayreduce the number of processes that can “fit” into the lower estimate.Thus, while fewer processes may be selected, those processes that areselected may have a higher likelihood of surviving in the background.

Similarly, the process management service 221 may also (oralternatively) adjust the estimation of the background memory thresholdat block 406 and the selection of a subset of process at block 408 basedon the current network connectivity of the computing device 102 a.Specifically, in instances in which the computing device 102 a has anetwork connectivity below a threshold network connectivity (e.g., acertain low connection speed), the process management service 221 maylower the background memory threshold service 221 as the low networkconnectivity may indicate that it may take longer to retrieve networkresources (e.g., web data) needed to restart one or more processes inthe group of processes. As such, the process management service 221 mayutilize a more conservative estimate of the amount of memory that isavailable for the group of processes in order to increase the likelihoodthat the processes selected at block 408 will not be terminated.Further, in the event of low network connectivity, the processmanagement service 221 may prioritize processes that will require morenetwork resources in order to restart those proposes over otherprocesses that may not require as much interaction with a network torestart.

In some optional embodiments (not shown), the process management service221 may select a subset of processes at block 408 and assign importancelevels at block 410 in response to determining that a triggering eventhas occurred. In such embodiments, the process management service 221may monitor for an indication that the computing device 102 a may berunning low of memory and, in response to detecting such an indication,may perform the operations at blocks 408 and 410. The triggering eventsmay include, for example, termination of a process in the group ofprocesses, receiving a notification that a process in the group is aboutto be terminated, and/or receiving a general notification that thecomputing device 102 a is running low on memory.

In some embodiments of the operations performed at block 408, theprocess management service 221 may receive a number of notifications(e.g., low-memory notifications) that the computing device 102 a isrunning low on memory or that one or more of the processes in the groupwill be terminated. In response to determining that the number ofreceived low-memory notifications exceeds a threshold number ofnotifications, the process management service 221 may decrease theestimated background threshold because more notifications may indicatethat there may be less memory available for the group of processes. Inparticular, receiving more notifications may indicate that there will bea high likelihood that the low-memory manager will need to free acomparatively large number of processes, and the process managementservice 221 may decrease the estimated background memory threshold inorder to select different and/or fewer processes at block 408 in orderto increase the likelihood that those selected processes will survive inthe background. On the other hand, the process management service 221may increase the estimated background memory threshold in response todetermining that a threshold number of low-memory notifications has notbeen received.

The process management service 221 may conclude performing theoperations of the subroutine 400 by returning to block 304 of theroutine 300 as described with reference to FIG. 3.

In some optional embodiments, the operations performed at blocks 404-410may be performed by the process management service 221, the stubprocess, or a combination of both the process management service 221 andthe stub process. For example, once the stub process has beensubstituted for the main process at block 402, the stub process mayperform the various operations described with reference to blocks404-410. As such, various operations described with reference to theprocess management service 221 may be implemented by or as part of thestub process.

FIG. 5A is a chart 500 illustrating memory usage of browser processesoperating in the background on a computing device according tosuboptimal implementations. Each process in a group of processes (e.g.,processes 504-512) may utilize/require a certain amount of memory whileoperating in the background. In the example illustrated in FIG. 5A, thegroup of processes 504-512 are operating in the background and assignedto a standard background importance level, such as the “background”importance level. While the computing device has a sufficient amount ofmemory available for more important processes (e.g., represented in FIG.5A as “Sufficient Memory”), the processes 504-512 continue to operatenormally in the background. However, in the event that more memory isneeded on the computing device (e.g., when the user launches a newapplication), the low-memory manager 219 may determine that theavailable memory on the computing device is low or insufficient(represented in FIG. 5A as “Low Memory”). As a result, the low-memorymanager 219 will begin terminating the processes 504-512 to free upmemory for the more important processes.

As described above, the low-memory manager 219 typically terminatesprocesses from processes in the lowest importance level to processes inthe highest importance level. Further, within each importance level, thelow-memory manager 219 terminates processes that use more memory beforethose processes that use less memory. As illustrated in chart 500, eachof the processes 504-512 is assigned to the same standard backgroundimportance level according to conventional implementations, and as aresult, the low-memory manager 219 will first terminate the main process512 because the main process 512 uses the most memory of the group ofprocesses 504-512. As each of the child processes 504-510 depends on themain process 512 to operate, terminating the main process 512 results inthe termination of the child processes 504-510. As a result, all of thedata and information associated with each of the processes 504-512 inthe group is lost, even though there may have been enough memory to keepsome of the child processes alive.

FIG. 5B is a chart 550 illustrating an example of implementing alow-memory mitigation process, according to some embodiments, such asthose described with reference to FIG. 4. Specifically, a processmanagement service (e.g., the process management service 221 of thecomputing device 102 a described with reference to FIG. 2) may estimatea total amount of memory that the group of processes 504-512 may utilizewhile in the background without being terminated by the low-memorymanager 219. In the example illustrated in FIG. 5B, the processmanagement service 221 may estimate that the processes 504-512 mayutilize a total amount of memory represented by the estimated backgroundmemory threshold 514. Based on the estimated background memory threshold514, the process management service 221 may determine an amount ofmemory that each of the processes 504-512 will require in the backgroundand may select a subset of the processes 504-512 that will use an amountof memory that does not exceed the background memory threshold. Forexample, the process management service 221 may select the main process512 and the second child process 506 because their combined memory usagein the background will not exceed the background memory threshold.

In some embodiments, the selection of processes may also be based on apriority of the processes, and the process management service 221 mayattempt to select higher priority processes if those processes would“fit” within the estimated background memory threshold. For example, theprocess management service 221 may determine that the main process 512is the most important process because the child processes 504-510 dependon the main process 512 to operate. As a result, the process managementservice 221 may include the main process 512 in the selected subset ofprocesses. The process management service 221 may consider various otherpriority criteria, such as the type of information associated with eachprocess (e.g., user form data), the cost of replacing or restarting eachprocess, recent use of a process by the user, etc. In additional (oralternative) embodiments, the process management service 221 may alsomake the selection based on a certain number of processes such that thenumber of processes in the selected subset does not exceed that numberof processes.

In response to selecting a subset of the processes 504-512 thatsatisfies the estimated background memory threshold 514, the processmanagement service 221 may lower the importance level for each of theprocesses in the group that were not selected. Thus, in the exampleillustrated in FIG. 5B, the process management service 221 may lower theimportance level of the child processes 504, 508, 510. In someembodiments (not shown), the process management service 221 may lowerthe importance levels just before the group of processes enters thebackground to avoid a situation in which the low-memory manager 219immediately terminates the processes in the group.

In the event that the low-memory manager 219 determines that thecomputing device has low available memory (represented in FIG. 5B as“Low Memory”), the low-memory manager 219 may begin terminating thechild processes 504, 508, 510 because of their lower importance levelrelative to the main process 512 and the second child process 506. Ifthe estimate of the background memory threshold is accurate (orsubstantially accurate), the low-memory manager 219 may not need toterminate the main process 512 and the second child process 506 becausea sufficient amount of memory may be freed by terminating one or more ofthe processes 504, 508, 510. Thus, by prioritizing and adjusting theimportance levels of some of the processes, the process managementservice 221 may decrease the likelihood that higher priority processes(e.g., the main process 512) will be terminated while operating in thebackground.

FIG. 6 is a process flow diagram of an illustrative subroutine 600 foradjusting a low-memory mitigation process, according to someembodiments. In some embodiments, the subroutine 600 may be implementedwith a process management service operating on a computing device (e.g.,the process management service 221 of the computing device 102 a asdescribed with reference to FIG. 2). The operations of the subroutine600 implement embodiments of the operations of block 308 of the routine300 as described with reference to FIG. 3.

As noted above, the process management service 221 (and various othercomponents on the computing device 102) may be unable to directly assessthe amount of memory that is actually available on the computing device.For example, some processes utilize shared memory with other processesor components of the computing device (e.g., the graphics driver of theoperating system 216) or have non-trivial memory interdependencies witheach other, and there may be no reliable way to determine how much ofthe shared memory is actually available. Further, while an applicationhosting a group of processes can query the operating system 216 todetermine how much free memory is available, the application cannot knowhow much memory can be freed by killing other lower importanceapplications or processes, and as a result, asking the operating system216 for the amount of free memory available on the computing deviceoften does not provide a meaningful measure of memory that is actuallyavailable on the computing device.

Thus, in order to accurately estimate an amount of memory that will beavailable for the group of processes in the background, the processmanagement service 221 may continually adjust the estimated backgroundmemory threshold based on the results of each previous estimate. Inother words, the process management service 221 may determine anestimate for the background memory, utilize that estimate to selectcertain processes to have a higher importance level in the background,determine whether those selected processes were terminated in thebackground, and adjust the estimated background memory threshold basedon whether the selected processes were terminated.

With reference to FIG. 6, the process management service 221 determineswhether at least one selected process was terminated in the backgroundin decision block 602. For example, the process management service 221may poll the selected processes for response. In another example, theprocess service 221 may check a record of SIGKILL signals received fromthe low-memory manager 219. In response to determining that at least oneselected process was terminated in the background (i.e., decision block602=“YES”), the process management service 221 adjusts the estimatedbackground memory threshold to be more restrictive, at block 604.Specifically, the process management service 221 may determine thattermination of one or more selected processes indicates that the currentestimated background memory threshold was higher than the memory thatwas actually available for use by the selected processes. As a result,the low-memory manager 219 may have terminated all of the non-selectedprocesses (associated with a comparatively lower importance level), aswell as at least one selected process (associated with a higherimportance level). The process management service 221 may reduce theestimated background memory threshold and utilize this reduced estimatedbackground memory threshold in the future. For example, the processmanagement service 221 may utilize the lower estimate the next time theprocess management service 221 selects processes at block 408 of thesubroutine 400, such as the next time the application transitions to thebackground. In some embodiments, reducing the estimated backgroundthreshold may limit the process management service 221 to selecting afewer number of processes and/or to select processes with an overallsmaller memory usage in order to satisfy the reduced threshold.

In some embodiments, the process management service 221 may determinewhether the processes that were terminated were terminated immediatelyupon entering the background or terminated at some later point whileoperating in the background. In such embodiments, the process managementservice 221 may reduce the estimated background memory thresholddepending on the circumstances in which the processes were terminated.For example, the process management service 221 may reduce the estimatemore in the event that the selected processes were terminatedimmediately upon entering background than in the event that the selectedprocesses were terminated at some later point while operating in thebackground. In this example, evidence that the processes were terminatedimmediately may indicate that the estimate deviated significantly fromthe actual amount of memory available, whereas evidence that theprocesses were terminated over time may indicate that the estimate wasnot accurate but may have been close to reflecting the actual memoryavailable on the computing device.

In response to determining that no selected process was terminated inthe background (i.e., decision block 602=“NO”), the process managementservice 221 adjusts the estimated background memory threshold to be lessrestrictive, at block 606. In particular, the process management service221 may determine that the estimated background memory threshold may beraised because the estimate may have underrepresented the actual memoryavailable to the group of processes. By raising the estimate, theprocess management service 221 may select more processes (or differentprocesses) the next time the application transitions to the background,thereby decreasing the likelihood that those additional (or different)processes will be terminated in the background.

In some embodiments, the process management service 221 may adjust theestimated background memory threshold at block 604 or block 606 based atleast in part on a number of low-memory notifications (e.g., generalnotifications of low memory on the computing device 102 a ornotifications that one or more processes in the group were terminated).For example, in response to determining that a threshold number oflow-memory notifications was received, the process management service221 may make a smaller adjustment to the estimated background memorythreshold at block 606 because, while all of the selected subset ofprocesses survived operating in the background, the large number ofnotifications may indicate that the estimated background memorythreshold is close to the actual amount of available memory. On theother hand, in response to determining that a threshold number oflow-memory notifications were not received, the process managementservice 221 may make a larger adjustment to the estimated backgroundmemory threshold at block 606 as the comparatively low number ofnotifications may indicate that the computing device is not likelyrunning low on memory. Additionally (or alternatively), the processmanagement service 221 may adjust the estimated background memorythreshold at block 604 or block 606 based on one or more notificationsthat indicates a level of memory available (e.g., low, normal, high).Based on these one or more notifications, the process management service221 may determine a particular probability or likelihood that there willbe sufficient memory for the selected processes in the future. Forexample, a notification indicating a normal amount of memory may beassociated with a higher likelihood that there will be sufficientmemory, whereas a notification indicating a low amount of memory mayindicate a lower likelihood. Similar operations may be performed atblock 604 consistent with the above description.

In response to adjusting the estimated background memory in one of block604 or 606, the device, the process management service 221 mayoptionally generate information regarding the estimated backgroundmemory threshold and the operational status of one or more of the groupof processes, in optional block 608. As described, this information mayindicate various characteristics of the computing device and processes,information regarding the original estimate of the memory available inthe background, and information regarding how the original estimate wasadjusted in light of the characteristics of the computing device andprocesses. This information may also include information regarding otherapplications that were operating while the processes were in thebackground, the power level of the computing device at that time, userprofile data associated with the processes, etc.

In optional block 610, the process management service 221 may transmitthe information generated in optional block 608 to a server, such as theserver described with reference to block 404 of the subroutine 400 (seeFIG. 4). In embodiments such as those described above, the server maycompare the information transmitted in optional block 610 with similarinformation received from other computing devices to identifycircumstances in which low-memory mitigation processes were successful(or not). The server may then share this crowd-sourced information withvarious computing device to enable them to intelligently implementlow-memory mitigation processes.

The process management service 221 may conclude performing theoperations of the subroutine 600 by returning to block 308 of theroutine 300 as described with reference to FIG. 3.

FIG. 7 is a chart 700 illustrating an example of adjusting estimates ofa background memory threshold over time, according to some embodiments,such as those described with reference to FIG. 6. An example of variousestimates of the background memory threshold is illustrated in the chart700. In this example, a process management service (e.g., the processmanagement service 221 of the computing device 102 a as described withreference to FIG. 2) may have utilized different estimated backgroundmemory thresholds 706 a-706 e and 708 a-708 d as part of implementing alow-memory mitigation process (see FIG. 3) at various times 712 a-712 j(illustrated in FIG. 7 as “T₁” through “T₁₀”), respectively. Anestimated background memory threshold appearing at or above actualbackground memory thresholds 714 a, 714 b (e.g., in the non-shadedportion of the chart 700) may indicate that using that estimatedbackground memory threshold resulted in the termination of one or moreof selected processes in the background. On the other hand, an estimatedbackground memory threshold appearing below the actual background memorythresholds 714 a, 714 b (e.g., in the shaded portion of the chart 700)may indicate using that estimated background memory threshold did notresult in termination of any of the selected processes in thebackground.

In the example illustrated in the chart 700, the process managementservice 221 may have initially utilized an estimated background memorythreshold 706 a, which did not result in the termination of any selectedprocesses. In response, the process management service 221 may have useda larger estimated background memory threshold 706 b at the later time712 b in an attempt to more accurately estimate the actual backgroundmemory threshold 710 a. However, because using the background memorythreshold 706 b may have resulted in the termination of one or moreselected processes, the process management service 221 may use a smallerestimated background memory threshold 706 c at the later time 712 c.Similarly, because one or more selected processes were terminated byusing the estimated background memory threshold 706 c, the processmanagement service 221 may utilize an even smaller estimated backgroundmemory threshold 706 d at the later time 712 d. Accordingly, the processmanagement service 221 may continue adjusting the estimated backgroundmemory at the time 712 e, as represented by the estimated backgroundmemory thresholds 706 e.

At the time 712 f, the available memory of the computing device maychange, such as in response to an upgrade in memory capabilities, othernew hardware, software updates, etc. In some embodiments, the processmanagement service 221 may be unable to directly determine the amount ofmemory that is available on the computing device as described above.However, the process management service 221 may indirectly determinethat a change in available memory has occurred by continuing to adjustthe estimate background memory threshold as described above. Thus, asillustrated in the chart 700 after the time 712 f, the processmanagement service 221 may use an estimated background memory threshold708 a that is significantly below the actual background memory threshold714 b because the process management service 221 is unaware of thechange in available memory on the computing device. However, because noselected processes were terminated by using the estimated backgroundmemory threshold 708 a, the process management service 221 may use alarger estimated background memory threshold 708 b at the later time 712h. Eventually, by continually adjusting the estimated background memorythreshold over time—as represented by estimated background memorythreshold 708 c-708 d at the times 712 i and 712 j—the processmanagement service 221 may get progressively closer to estimating theactual background memory threshold 714 b without having directinformation regarding the amount of memory that is actually available onthe computing device.

FIG. 8 is a process flow diagram of an illustrative subroutine 800 forimplementing a low-memory mitigation process by assigning low-importancelevels to one or more processes in a group of processes based on therespective priorities of processes in the group, according to someembodiments. In some embodiments, the subroutine 800 may be implementedwith a process management service operating on a computing device (e.g.,the process management service 221 of the computing device 102 a asdescribed with reference to FIG. 2). The operations of the subroutine800 implement an embodiment of the operations of block 304 of theroutine 300 (e.g., as described with reference to FIG. 3). In suchembodiments, the process management service 221 may begin performing theoperations of the subroutine 800 in response to determining that anapplication is transitioning to the background at block 302 of theroutine 300.

In optional block 802, the process management service 221 may optionallysubstitute a main process of the plurality of with a stub process, suchas by creating a “placeholder” process that may manage connections tothe child processes associated with the main process and terminating themain process. In some embodiments of the operations performed inoptional block 802, the process management service 221 may performoperations similar to those operations described with reference tooptional block 402 of the subroutine 400 (e.g., as described withreference to FIG. 4).

At block 804, the process management service 221 may determine apriority order for the group of processes. In some embodiments, theprocess management service 221 may determine or calculate a “cost” ofreplacing or reloading each of the processes. As noted above, the costsof replacing a process may include, among other factors, an expectedamount of time needed to replace the process, an expected amount ofprocessing power needed to replace the process, an expected amount ofbattery power needed to replace the process, whether the process isassociated with hard-to-replace data (e.g., user form input or gamestate information), and various other criteria. The process managementservice 221 may also (or alternatively) use various other criteria toprioritize the processes, such as prioritizing processes that have beenfrequently or recently used by the user higher than processes that theuser has not been used as frequently and/or as recently.

At block 806, the process management service 221 assigns importancelevels to the group of processes based at least in part on the priorityorder of the processes determined at block 804. In some embodiments, theprocess management service 221 may assign two or more distinctimportance level to the processes in the group. For example, the processmanagement service 221 may assign a certain number of lower-priorityprocesses in the group to a low importance level (e.g., a cachedimportance level) and may assign a high or elevated importance level tothe remaining processes (e.g., a service importance level). In anotherexample, in addition to assigning a low importance level and a highimportance level to the processes, the process management service 221may additionally assign a certain number of processes in the group to anintermediate or standard importance level (e.g., a background importancelevel). As described below, having processes assigned to more than twoimportance levels may allow the process management service 221additional time to detect processes that are terminated and additionaltime to react to those terminations by reassigning one or more processesto a lower importance level (e.g., as further described with referenceto FIG. 10).

As discussed above, data associated with a process may be stored orserialized in order to preserve potentially difficult-to-replace data,such as user input or form data. However, saving state information andother data associated with a process may require the use of significantpower and processing resources and may affect the performance of anotherprocess. For example, while serializing a process, another process thatis rendering graphics on a display may be adversely affected. In lightof the above, the process management service 221 may prioritizeprocesses in the group such that processes that may benefit fromserializing or storing their data in anticipation of termination mayhave a relatively high priority and/or may be associated with higherimportance levels, in some embodiments. As a result, the processmanagement service 221 may delay or avoid having to initiate theserialization or storing of those processes' data until lower-priorityprocesses have been terminated. In other words, because the terminationof lower-priority processes may signal an increased risk of terminationfor higher-priority processes, the process management service 221 maybegin the costly process of serializing higher-priority processes onlyin response to determining that there is a high likelihood that thosehigher-priority processes will be terminated based on the termination oflower-priority processes.

Further, in some embodiments, the process management service may assignimportance levels to processes that may not ordinarily be available tothose processes. For example, while the group of processes is operatingin the background, the operating system 216 may typically allow theprocesses to have a low importance level (e.g., a cached importancelevel) or a standard importance level (e.g., a background importancelevel). However, as the low-memory manager 219 may terminate severalprocesses at once (including, in some cases, groups of processes), theprocess management service 221 may assign one or more of the highestpriority processes to an elevated importance level that is not typicallyassigned to processes operating in the background (e.g., a visibleimportance level).

In some embodiments of the operations performed at block 806, theprocess management service 221 may utilize “virtual” importance levelsto order the processes. In such embodiments, the virtual importancelevels may be a ranking or ordering of the processes assigned to acommon importance level. For example, the process management service 221may notify the operating system 216 or low-memory manager 219 of therelative importance of each process assigned to a particular importancelevel. As such, the process management service 221 may enable thelow-memory manager 219 to terminate processes in the same importancelevel based on these “virtual” importance levels. In some instance,rather than reassigning the processes to different importance levels atblock 806, the process management service 221 may maintain the common orusual importance level of the processes and may instead assign virtualimportance levels to each of the processes based on their priorityorder.

The process management service 221 may conclude performing theoperations of the subroutine 800 by returning to block 304 of theroutine 300 as described with reference to FIG. 3.

While the above description of the operations performed in thesubroutine 800 are described with reference to the processes operatingin the background, the process management service 221 may performoperations similar to those described above with reference to blocks802, 804, and 806 while the processes are operating in the foreground.In such embodiments, the process management service 221 may alsodetermine a priority order for the group of processes at block 804 andassign importance levels to the processes based on that priority orderat block 806.

In some optional embodiments, the operations performed at blocks 804-806may be performed by the process management service 221, the stubprocess, or a combination of both the process management service 221 andthe stub process. For example, once the stub process has beensubstituted for the main process at block 802, the stub process mayperform the various operations described with reference to blocks804-806. As such, various operations described with reference to theprocess management service 221 may be implemented by or as part of thestub process.

FIG. 9 is a process flow diagram of an illustrative subroutine 900 forcontinuing an implementation of a low-memory mitigation process bydynamically reassigning one or more processes in a group of processes tolower-importance levels in response to the termination of one or moreother processes in the group, according to some embodiments. In someembodiments, the subroutine 900 may be implemented with a processmanagement service operating on a computing device (e.g., the processmanagement service 221 of the computing device 102 a as described withreference to FIG. 2). The operations of the subroutine 900 implement anembodiment of the operations of block 310 of the routine 300 (e.g., asdescribed with reference to FIG. 3). In some embodiments, the processmanagement service 221 may begin performing the operations of thesubroutine 900 while the application is operating in the background(e.g., decision block 308 of the routine 300=“NO”).

In decision block 902, the process management service 221 determineswhether a process assigned to a low-importance level has beenterminated. For example, the process management service 221 maydetermine whether a low-memory manager 219 or the operating system 216has sent a signal initiating the termination of one or more processes.In other examples, the process management service 221 may determine thata process assigned to a low-importance level has been terminatedindirectly, such as by periodically polling the processes in the groupto identify processes that are not responsive.

In some embodiments, in response to determining that a process assignedto a low-importance level has been terminated (i.e., decision block902=“YES”), the process management service 221 determines a number ofprocesses to reassign to a lower-importance level at block 904. In someembodiments, the process management service 221 may calculate an amountof time that has passed between terminations, which may indirectlyindicate or suggest the likelihood that the low-memory manager 219 willcontinue terminating processes. Specifically, a greater period of timebetween terminations may indicate that the low-memory manager 219 didnot need to free a lot of memory in a relatively short period of time toaccommodate the memory requirements of other applications (e.g., thereis not a significant overall memory pressure). In contrast, a shorterperiod of time between terminations may indicate that the low-memorymanager 219 was required to aggressively free up memory by terminatingprocesses in rapid succession, thereby indicating a higher likelihoodthat the computing device is experiencing a more intense memoryshortage. In such embodiments, the process management service 221 mayreassign a comparatively smaller number of processes to thelow-importance level when the time period between terminations islonger, and may assign a comparatively larger number of processes to thelow-importance level when the time period between terminations isshorter.

In some embodiments, the process management service 221 may use othertechniques to indirectly determine the likelihood that the low-memorymanager 219 will continue terminating processes, and thus how manyprocesses should be reassigned to lower-importance levels to prevent thelow-memory manager 219 from terminating the highest priority processesin the group. For example, the process management service 221 may submitan input/output (I/O) request to the operating system 216 and maymeasure the latency of the operating system 216's response to the I/Orequest. Alternatively (or additionally), the process management service221 may measure the latency of performing a processing task.Specifically, the process management service 221 may determine that thecomputing device may be running low on memory (and thus the low-memorymanager 219 will likely continue terminating processes) in the eventthat the response to the I/O request or the completion of the processingtask takes longer than expected. On the other hand, the processmanagement service 221 may determine that there is a lower likelihood ofa memory shortage on the computing device when the response to the I/Orequest is prompt and/or the processing task is completed quickly. Insome embodiments, the process management service 221 may receiveindications of the current performance of the computing device (e.g.,current I/O levels for storage or network operations, CPU usagepercentage, etc.) and may use those indications to determine thelikelihood that the low-memory manager 219 will start or resumeterminating processes. In such embodiments, the process managementservice 221 may receive this performance information from the operatingsystem. Alternatively (or additionally), the process management service221 may receive similar performance information regarding tasksperformed by the group of processes, such as from the browserapplication 218.

At block 906, the process management service 221 reassigns thedetermined number of processes from the elevated importance level to thelow-importance level, thereby decreasing the likelihood thathigher-priority processes in the group will not be terminated, asdescribed above. In some instance, the process management service 221may consider dependencies among the processes when reassigning processesto lower importance levels at block 906. For example, one process thatdepends on another process may be reassigned to a lower importance levelbefore (or instead of) the other process.

In some embodiments, the process management service 221 may reassignprocesses to lower importance levels in response to determining thatthose processes have had their state information stored or serialized.Specifically, a process that includes hard-to-replace data (e.g., userprofile data or form data) may have a higher priority relative to otherprocesses in the group until that hard-to-replace data is stored orserialized (e.g., until the data becomes more easily recoverable). Atthat time, the process management service 221 may lower the priorityand/or importance level of the process as the cost of replacing thatprocess may be significantly reduced after serializing the stateinformation. In some further embodiments, the process management service221 may voluntarily terminate processes after their state information isstored or serialized.

In response to reassigning the determined number of processes tolower-importance levels at block 906 or in response to determining thata process assigned to a low-importance level has not been terminated(i.e., decision block 902=“NO”), the process management service 221 maycontinue performing operations by returning to block 310 of the routine300.

In some optional embodiments, in response to determining that a processassigned to a low-importance level has not been terminated (i.e.,decision block 902=“NO”), the process management service 221 maydetermine whether a threshold amount of time has elapsed since a mostrecent process termination has occurred, in optional decision block 908.In such embodiments, the process management service 221 may maintain atimer or otherwise track an amount of time that has elapsed since thelast process in the group was terminated. The amount of time that haselapsed may be an indirect indication of the amount of memory that isavailable on the computing device 102 a and thus an indirect indicationof the likelihood that processes assigned to lower importance levelswill be terminated. For example, in the event that no process has beenterminated in a threshold amount of time, the process management service221 may determine that it may not be necessary to have a large number ofprocesses assigned to a low importance level, which may put thoseprocesses at a higher risk of being terminated as noted above. As such,in response to determining that a threshold amount of time has elapsedsince the most recent process termination (i.e., optional decision block908=“YES”), the process management service 221 may reassign one or moreprocesses to a higher importance level from a lower importance level, atoptional block 910. The process management service 221 may reassign,revert, or restore the importance level of one or more processes to ahigher importance level after previously assigning those importancelevels to a lower importance level. In an example, the processmanagement service 221 may have initially assigned a process to anelevated importance level based on its priority relative to otherprocesses in the group. At some later point, the process managementservice 221 may have reassigned the process to a standard or lowimportance level in anticipation of an aggressive termination ofnumerous processes by the low-memory manager. Thus, in the event thatthe process management service 221 determines that a threshold amount oftime has elapsed since the last termination, the process managementservice 221 may determine there is a low risk that the low-memorymanager will terminate a large number of processes, and as such, theprocess management service 221 may restore that process to an elevatedimportance level to ensure that that process with a relatively highpriority has a lower likelihood of being terminated. In this way, theprocess management service 221 may further adjust the importance levelsof one or more processes dynamically in order to control the order inwhich processes are terminated based on indirect evidence of availablememory on the computing device 102 a.

In some embodiments, the process management service 221 may revert orrestore the original importance levels of processes in the group afterreassigning them to a lower importance level by performing theoperations at optional block 910 in one or more iterations. For example,the process management service 221 may reset the timer used to monitorthe threshold amount of time each time after performing the operationsat optional blocks 908 and 910. As such, the process management service221 may perform the operations at optional blocks 908 and 910 each timethe timer exceeds the threshold amount of time. In such embodiments, theprocess management service 221 may eventually restore the originalimportance levels for each process in the group that has not alreadybeen terminated.

In response to reassigning one or more processes from a lower importancelevel to a higher importance level at optional block 910 or in responseto determining that a threshold amount of time has not elapsed since amost recent process termination has occurred (i.e., decision block908=“NO”), the process management service 221 may continue performingoperations by returning to block 310 of the routine 300.

While various embodiments of the operations of the process managementservice 221 performed with reference to the subroutines 800 and 900 aredescribed with reference to the group of processes operating in thebackground, the process management service may perform similaroperations while the group of processes is operating in another state,such as in the foreground. For example, the process management service221 may similar determine a priority order for a group of processesoperating in the foreground and assign two or more importance levels tothe processes in the group to influence the order in which a low-memorymanager will terminate those processes.

FIG. 10 is a time-line diagram 1000 illustrating dynamically assigninglow-importance levels to one or more processes in a group of processesbased on the respective priorities of processes in the group, accordingto some embodiments. As described, a process management serviceoperating on a computing device (e.g., the process management service221 as described with reference to FIG. 2) may actively and dynamicallyadjust the importance levels assigned to a group of processes in anattempt to ensure that those processes in the group with higherpriorities may have a lower likelihood of being terminated in thebackground.

In the example illustrated in FIG. 10, the process management service221 may determine at a time 1002 that an application associated with agroup of processes is transitioning to the background, at block 302(e.g., as described with reference to the routine 300 of FIG. 3). At thetime 1002, the group of processes (illustrated in FIG. 10 as Processes1-10) may all be assigned to the same importance level, such as anelevated background importance. At a time 1004, the process managementservice 221 may assign importance levels to each process in the groupbased on a determine priority order of the processes, at block 806(e.g., as described with reference to method 304 b of FIG. 8). Forexample, each process in the group may be ranked at the time 1004 basedon one or more of an expected cost of replacing the process, whether theprocess is associated with hard-to-replace information (e.g., game stateinformation, user form input data, etc.), and various other factors.

In some embodiments, the process management service 221 may stratify theprocesses by assigning different importance levels to different subsetsof the group of processes. In the example illustrated in FIG. 10, theprocess management service 221 may assign Processes 1, 6, and 4 to a lowbackground importance level, Processes 7, 2, and 10 to an intermediatebackground importance level, and may assign (or maintain) the elevatedbackground importance level to Processes 5, 1, 8, and 9. As noted above,these assignments may be based on the relative priorities of theprocesses. In the example illustrated in FIG. 10 and for ease ofdescription, the Processes 1-10 are illustrated in ascending order ofpriority from the process with the lowest priority (Process 4) to theprocess with the highest priority (Process 10). For instance, Process 4may have a lower priority than Process 5, which in turn may have a lowerpriority than Process 7. By assigning importance levels to the Processes1-10 based on their respective priorities, the process managementservice 221 may ensure that the low-memory manager 219 terminateslower-priority processes before higher-priority processes in the eventthat the low-memory manager 219 begins terminating the processes in thebackground to free additional memory.

At a time 1006, the process management service 221 may determine thatProcess 4 has been (or will be) terminated, at block 902 (e.g., asdescribed with reference to subroutine 900 of FIG. 9). For example, theprocess management service 221 may receive an indication from theoperating system 216 or from the low-memory manager 219 that Process 4specifically is scheduled as the next process to be terminated, or theprocess management service 221 may determine that a termination signalfor Process 4 has been received. The indication that Process 4 wasterminated or will be terminated may indicate that the computing devicehas insufficient available memory for more important applications, whichmay further indicate that the low-memory manager 219 will continueterminating processes if additional memory is still needed. As describedabove, the process management service 221 may be unable to directlydetermine the amount of memory that is available on the computingdevice, and thus may determine that the termination of the Process 4indicates a greater likelihood that additional processes will beterminated.

In response to the termination of Process 4, the process managementservice 221 may reassign a determined number of the processes that areremaining in the group (e.g., Process 1-3 and 5-10) to lower importancelevels, at block 906 (e.g., as described with reference to thesubroutine 900 of FIG. 9) at a time 1008. Specifically, the processmanagement service 221 may lower the importance levels of one or more ofthe processes in the group to replace any terminated process and toensure that the highest priority processes in the group continue to be“shielded” from termination by the low-memory manager 219.

In the example illustrated in FIG. 10, the processes management servicemay determine that only one process (Process 4) was terminated, whichmay indicate that the computing device may only be slightly low onmemory and that the low-memory manager 219 will not need to terminateseveral processes in the near future. In this example, the processesmanagement service may determine that only one or a few processes shouldbe reassigned to lower importance levels because the likelihood oflosing many processes at substantially the same time is currently low.As such, the process management service 221 may lower the importancelevel of the Process 5 from an intermediate background importance levelto a low background importance level to “replace” Process 4. Similarly,the process management service 221 may lower the priority of Process 7to the intermediate background importance level to “replace” Process 5.

In determining which of the processes assigned to each importance levelto reassign to a lower importance level, the process management service221 reassign processes based on their priorities relative to otherprocesses assigned to the same importance level. Thus, in the exampleillustrated in FIG. 10, at the time 1008, the process management service221 may reassign Process 5 to the low background importance levelbecause Process 5 has the lowest priority process among the processesassigned to the intermediate background importance level. Similarly, theprocess management service 221 may reassign Process 7 to theintermediate background importance level from the elevated backgroundimportance level because Process 7 had the lowest priority among theprocesses assigned to the elevated background importance level.

At a time 1010, the process management service 221 may detect thatprocesses have been terminated, at block 902, such as by performingoperations as described above. Specifically, at the time 1010, theprocess management service 221 may determine that the low-memory manager219 has begun to terminate processes aggressively in order to free alarge amount of memory. In the illustrated example, the processmanagement service 221 may determine that the low-memory manager 219terminated Processes 1, 2, 5, and 6. The process management service 221may also determine that there is a considerable likelihood that thelow-memory manager 219 will continue to terminate processes in view ofthe relatively large number of processes in the group that wereterminated. In some embodiments, the process management service 221 maydetermine whether processes assigned to the intermediate backgroundimportance level have been terminated, which may indicate that thelow-memory manager 219 has terminated all available processes assignedto the low background importance level without freeing up a sufficientamount of memory, thereby causing the low-memory manager 219 to beginterminating processes in higher importance levels. In the exampleillustrated in FIG. 10, the process management service 221 may determinethat Process 2 was assigned to the intermediate background importancelevel and that Process 2 has been terminated, indicating a heighten riskthat the low-memory manager 219 will continue terminatinghigher-priority processes in the group.

Thus, at a time 1012, the process management service 221 may againreassign a determined number of processes in the group to lowerimportance levels to respond to the low-memory manager 219's aggressivetermination of Processes 1, 2, 5, and 6, at block 902. Specifically, theprocess management service 221 may determine the number of processes toreassign based at least in part on the number of processes that wereterminated or are expected to be terminated. In some embodiments in theprocess management service 221 determines that there is a highlikelihood that all of the processes in the group may be terminated, theprocess management service 221 may lower the importance levels for allbut the highest priority processes to the low background importancelevel in the hopes that the low-memory manager 219 will be able to freethe needed amount of memory without needing to terminate the highestpriority processes in the group. In the example illustrated in FIG. 10,the process management service 221 may lower the importance levels ofthe Processes 3, 7, 8, and 9 to the lowest importance level (e.g., thelow background importance level) to provide a buffer for Process 10,which may be the highest priority process in the group, for example,because Process 10 is the main process of the group. Therefore, bydynamically adjusting the importance levels for the processes in thegroup in response to terminations of one or more processes in the group,the process management service 221 may effectively determine the orderin which the processes are terminated to increase the likelihood thathigher priority processes will survive in the background.

FIG. 11 is a process flow diagram of a subroutine 1100 for implementinga low-memory mitigation process by replacing a main process of a groupof processes with a stub process, according to some embodiments. In someembodiments, the method 1100 may be implemented with a processmanagement service operating on a computing device (e.g., the processmanagement service 221 of the computing device 102 a as described withreference to FIG. 2). In some optional embodiments, the operations ofthe subroutine 1100 implement an embodiment of the operations of block304 of the method 304 as described with reference to FIG. 3. In suchembodiments, the process management service 221 may begin performing theoperations of the subroutine 1100 in response to determining that theapplication is transitioning to the background at block 302 of theroutine 300 (e.g., as described with reference to FIG. 3).

In some embodiments, an application (e.g., the browser application 218)may include and/or be associated with a main process and one or morechild processes. The main process may coordinate the activities of theone or more child processes, as well as managing the process handles,bindings, and/or process IDs for the one or more child processes. Asdescribed above, in the event that the main process is terminated, theprocess handles and/or process IDs for the one or more child processesmay be lost, resulting in the termination of those child processes.Further, in comparison to the memory usage of each of the one or morechild processes, the main process may require a considerably largeramount of memory. As such, after the browser application 218 hastransitioned to the background, the main process may be at a higher riskof termination in comparison with the risk that a child process will beterminated because the low-memory manager 219 may terminate the mainprocess due to the comparatively large amount of memory the main processuses. To avoid termination of the main process, as well as the one ormore child processes, the main process may be temporarily replaced withthe stub process while the browsing application is operating in thebackground, as further described in the following operations.

At block 1102, the process management service 221 creates a stubprocess. In some embodiments, the stub process may be a process with noor limited functionality. For example, the stub process may not includeor load a full complement (or any) software libraries and may not beable perform any active services or operations. As a result, the stubprocess may have a memory usage that is significantly less than thememory usage of the main process. In a non-limiting example, the stubprocess may use five megabytes of memory, whereas the main applicationmay use one-hundred megabytes of memory.

In some embodiments of the operations performed at block 1102, theprocess management service 221 may create the stub process in responseto a low-memory triggering event. The low-memory triggering event mayoccur when the process management service 221 receives a low-memoryindication from the low-memory manager 219, which may indicate that themain process is scheduled for termination. Other triggering events mayinclude an indication that the application is about to transition to thebackground (e.g., as described with reference to block 302 of FIG. 3) orthat a child process has been terminated. In another example, alow-memory triggering event may occur in response to the creation of achild process. In this example, the process management server 221 maydetermine that the creation of the child process is associated with alow-memory notification. In yet another example, the process managementservice 221 may determine that a low-memory triggering event hasoccurred based on one or more flags that are used to create the childprocess (e.g., a low-memory flag). These flags may be used in an effortto decrease the likelihood that the child process will be terminated andmay be set by the process management service 221, the user, theoperating system 216, the low-memory manager 219, or one or more othercomponents operating on the computing device 102 a.

In some embodiments, the process management service 221 may wait tocreate the stub process and terminate the main process at block 1112 asdescribed further herein until there is some evidence that the computingdevice is running low on memory and that the main process may be alikely target for termination due to its comparatively large memoryusage.

At block 1104, the process management service 221 may initiate transferof a process handle of a child process from a main process to the stubprocess, such as by establishing inter-process communication channelsbetween the stub process and the main process to enable the main processto transfer the handles/identifiers for the child process to the stubprocess. Other processes for exchanging child handles, identifyinginformation, and other information necessary to maintain the childprocesses may be employed. For example, the process management servicemay determine a service name of the child process and may transfer theprocess handle of the child process from the main process to the stubprocess using the service name of the child, such as by performing alook up of the child's service name and determining the child's processhandle information based on the look up. In another example, the processmanagement service 221 may create or open a shared memory location(e.g., a shared file or a shared memory file) using a predeterminednaming schedule. In this example, the process management service 221 maycause the main process to write process handle information for the childprocess to the shared memory location, and process management service221 may notify the stub process of the availability of this informationin the shared memory location. In response, the stub process may accessthe shared memory location to obtain the process handle information ofthe child process. By transferring the process handle of the childprocesses to the stub process, the process management service 221 maylower the likelihood that the low-memory manager 219 will terminate theentire group of processes because the stub process uses much less memorythan the main process, and the low-memory manager 219 typicallyterminates processes that use more memory before those that use lessmemory, as described.

In some optional embodiments, the process management service 221 mayoptionally store state information for the main process, in optionalblock 1106. For example, the process management service 221 may initiateserialization of state information for the main process, and thisserialized state information may be stored locally on the computingdevice and/or remotely, such as in a data storage unit of a server incommunication with the computing device (e.g., the server 118 of FIG.1). The serialized information may include customer information, forminput data, application state information, and various otherinformation/data.

In some optional embodiments, once the transfer of the process handle ofthe child process from the main process to the stub process hascompleted at block 1104, the process management service 221 mayoptionally terminate the main process, at optional block 1108. Byterminating the main process (which may be using a relatively largeamount of memory), the process management service 221 may preemptivelyfree up memory on the computing device 102 a and, as a result, decreasethe likelihood that the low-memory manager 219 will need to terminateprocesses in the group to free up additional memory.

In some embodiments, rather than terminating the main process atoptional block 1108, the process management service 221 may allow boththe main process and the stub process to operate. When the group ofprocesses returns to the foreground, the process handle of the childprocess may be transferred back from the stub process to the mainprocess in the event that the main process was not terminated while inthe background. In this event, the process management service 221 maynot need to expend resources to restart the main process.

In some other embodiments (not shown), rather than terminating the mainprocess at optional block 1108, the process management service 221 maylower the importance level of the main process (e.g., to a cachedimportance level) so that the main process will be terminated before theother process in the group in the event that the low-memory managerneeds to free memory. However, in the event that the low-memory managerdoes not need to terminate the main process, the main process may notneed to be restarted, thereby saving the cost of restarting the mainprocess in terms of power, time, and processing resources. In suchembodiments, the process management service 221 may cause the assignmentof a low importance level to the main process by notifying the operatingsystem 216 that the main process has a low importance or priority or byassigning the main process to the low importance level, such as byutilizing service calls to the operating system to directly change theimportance level of the main process.

Thus, the process management service 221 may continue performingoperations in decision block 308 of the routine 300 (e.g., as describedwith reference to FIG. 3), in some optional embodiments. In otherembodiments, the process management service 221 may continue byperforming receiving information regarding background memory thresholdsutilized on similar computing device from a server, at block 404 of thesubroutine 400 (e.g., as described with reference to FIG. 4).

The process management service 221 may conclude performing theoperations of the subroutine 1100 by returning to block 304 of theroutine 300 (see FIG. 3).

In some embodiments, rather than creating the stub process at block1102, the process management service 221 may utilize a stub process thatis already operating on the computing device 102 a. For example, thestub process may be a system process (e.g., a daemon) that waspreviously created, either by the process management service 221 or bythe operating system 216. In further embodiments, once created, the stubprocess may not be terminated by the low-memory manager, for example,because the stub process is associated with a very high or “unkillable”importance level. In these circumstances, the stub process may functionas a permanent or semi-permanent “placeholder” that maintains processhandles. The process management service 221 may then utilize thepre-existing stub process to receive and manage child process handlesfrom a main process before terminating the main process, and uponrestarting the main process, may transfer the child process handles backto the restarted main process without terminating the stub process.

While the above descriptions refer to a “stub process,” in someembodiments, the process management service 221 may replace the mainprocess with a parallel process. In such embodiments, the parallelprocess may include more functionality than the stub process, but maystill require less memory than the main process. For example, theprocess management service 221 may initiate the creation of a new mainprocess. The new main process may require less memory than the old mainprocess because the new main process has not been used and thus may haveaccumulated/been associated with less data than the old main processand, as a result, may need less memory to operate than the old mainprocess.

FIG. 12 is a process flow diagram of an illustrative subroutine 1200 forcontinuing the implementation of a low-memory mitigation process byforwarding browser data from a stub process to a network-based browserfor processing, according to some embodiments. In some embodiments, thesubroutine 1200 may be implemented with a process management serviceoperating on a computing device (e.g., the process management service221 of the computing device 102 a as described with reference to FIG.2). In some optional embodiments, the operations of the subroutine 1200implement an embodiment of the operations of block 310 of the routine300 as described with reference to FIG. 3. In such embodiments, theprocess management service 221 may begin performing the operations ofthe method 1200 in response to determining that the application isoperating in the background in decision block 306 of the routine 300.

As described above, the stub process may have limited or nofunctionality and thus may be unable to perform typical operations thatthe browser application 218 may perform in the background. However, insome embodiments, the process management service 221 may leverage anetwork-based browser application (e.g., the network-based browserapplication 126) to perform various browser-related operations that thestub process may be unable to accomplish. Thus, in such embodiments, theprocess management service 221 establishes a connection with anetwork-based browser service, at block 1202. In some embodiments, thenetwork-based browser service may operate on a server (e.g., the server118 as described with reference to FIG. 2).

The process management service 221 also monitors for browser data and/orbrowser instructions sent to the stub process for use or processing, atblock 1204. In an example, this browser data may originate from a childprocess, the operating system 216, and/or various other entitiesoperating locally on the computing. In another example, this browserdata may originate from one or more other computing devices, resourceservers, and/or various other network components.

In decision block 1206, the process management service 221 determineswhether browser data and/or browser instructions have been sent to thestub process. In response to determining that browser data and/orbrowser instructions have been sent to the stub process (i.e., decisionblock 1206=“YES”), the process management service 221 forwards thereceived browser data and/or browser instructions to the network-basedbrowser application for processing, at block 1210. In particular, byforwarding the data to the network-based browser application, theprocess management service 221 may enable partial backgroundfunctionality of the browser application 218 on the computing device forwhich the main process would have ordinarily been responsible whileusing the stub process to decrease the likelihood that the entire groupof processes related to the browser application 218 will be terminatedby the low-memory manager 219.

In response to determining that no browser data and/or browserinstructions have been sent to the stub process (i.e., decision block1206=“NO”) or in response to forwarding the received browser data and/orinstructions at block 1210, the process management service 221 mayconclude performing the operations of the subroutine 1200 by returningto block 310 of the routine 300 as described with reference to FIG. 3.

FIG. 13 is a process flow diagram of a subroutine 1300 for resumingnormal application operations by replacing a stub process with a mainprocess, according to some embodiments. In some embodiments, thesubroutine 1300 may be implemented with a process management serviceoperating on a computing device (e.g., the process management service221 of the computing device 102 a as described with reference to FIG.2). The operations of the subroutine 1300 implement an embodiment of theoperations of block 312 of the routine 300 as described with referenceto FIG. 3. Thus, the process management service 221 may begin performingthe operations of the subroutine 1300 in response to determining thatthe application is not operating (or no longer operating) in thebackground (i.e., decision block 306 of the routine 300=“NO”).

At block 1302, the process management service 221 may determine that amain process has started. For example, the process management service221 may monitor for an indication from the operating system 216 that theuser has restarted the application. In decision block 1304, the processmanagement service 221 may determine whether an active stub process isassociated with the main process. As described above (e.g., withreference to FIG. 11), the process management service 221 may substitutea stub process for a main process in order to reduce the overall memoryusage of a group of processes related to the application, therebyreducing the likelihood that the low-memory manager will terminate theentire group of processes. Further, as part of replacing the mainprocess with the stub process, the process management service 221 maystore associate identifying information for the stub process with themain process, in some embodiments. Thus, once the main process restarts,the process management service 221 may reference this stored informationto locate and/or identify the stub process associated with the mainprocess.

In response to determining that a stub process is associated with themain process (i.e., decision block 1304=“YES”), the process managementservice 221 may optionally determine whether there is stored stateinformation associated with the main process, in optional decision block1310. Thus, in response to determining that there is stored stateinformation associated with the main process (i.e., optional decisionblock 1306=“YES”), the process management service 221 may load/reloadthe stored state information associated with the main process, inoptional block 1308. As described (e.g., in optional block 1310 of thesubroutine 1300), before terminating the main process and replacing itwith a stub process, the process management service 221 may storevarious information related to the main process, either locally or in anetwork-based data repository, until the main process restarts. Thisserialized information may be reloaded into the main process, therebyrecovering information that may have otherwise been lost uponterminating the main process.

In response to determining that there is no stored state informationassociated with the main process (i.e., optional decision block1306=“NO”) or while/subsequent to loading the stored state informationin optional block 1308, the process management service 221 may initiatetransfer of a process handle of a child process from the stub processassociated with the main process to the main process, at block 1310. Insome embodiments of the operations performed at block 1310, the processmanagement service 221 may reverse the operations performed at block1104 of the subroutine 1100 as described with reference to FIG. 11.

Upon completion of the operations at block 1310, the process managementservice 221 may terminate the stub process at block 1312 as theapplication may no longer be operating in the background and the stubprocess may no longer been needed to reduce the likelihood that one ormore processes associated with the application will be terminated in thebackground.

In response to determining that there is no stub process associated withthe main processes (i.e., decision block 1304=“NO”) or in response toterminating the stub process at block 1312, the process managementservice 221 may conclude performing the operations of the subroutine1300 by returning to block 312 of the routine 300 as described withreference to FIG. 3.

For ease of description, various embodiments described in thisdescription may refer to a group of processes or a set of linkedprocesses associated with a browser application 218. However, theprocess management service 221 may implement various embodimentsdescribed above to implement low-memory mitigation processes for groupsof processes associated with various other types of applications. Insuch embodiments, the process management service 221 may performoperations similar to those operations described above for groups ofprocesses related to various types of applications.

It is to be understood that not necessarily all objects or advantagesmay be achieved in accordance with any particular embodiment describedherein. Thus, for example, those skilled in the art will recognize thatcertain embodiments may be configured to operate in a manner thatachieves or optimizes one advantage or group of advantages as taughtherein without necessarily achieving other objects or advantages as maybe taught or suggested herein.

All of the processes described herein may be embodied in, and fullyautomated via, software code modules executed by a computing system thatincludes one or more computers or processors. The code modules may bestored in any type of non-transitory computer-readable medium or othercomputer storage device. Some or all the methods may be embodied inspecialized computer hardware.

Many other variations than those described herein will be apparent fromthis disclosure. For example, depending on the embodiment, certain acts,events, or functions of any of the algorithms described herein can beperformed in a different sequence, can be added, merged, or left outaltogether (e.g., not all described acts or events are necessary for thepractice of the algorithms). Moreover, in certain embodiments, acts orevents can be performed concurrently, e.g., through multi-threadedprocessing, interrupt processing, or multiple processors or processorcores or on other parallel architectures, rather than sequentially. Inaddition, different tasks or processes can be performed by differentmachines and/or computing systems that can function together.

The various illustrative logical blocks and modules described inconnection with the embodiments disclosed herein can be implemented orperformed by a machine, such as a processing unit or processor, adigital signal processor (DSP), an application specific integratedcircuit (ASIC), a field programmable gate array (FPGA) or otherprogrammable logic device, discrete gate or transistor logic, discretehardware components, or any combination thereof designed to perform thefunctions described herein. A processor can be a microprocessor, but inthe alternative, the processor can be a controller, microcontroller, orstate machine, combinations of the same, or the like. A processor caninclude electrical circuitry configured to process computer-executableinstructions. In another embodiment, a processor includes an FPGA orother programmable device that performs logic operations withoutprocessing computer-executable instructions. A processor can also beimplemented as a combination of computing devices, e.g., a combinationof a DSP and a microprocessor, a plurality of microprocessors, one ormore microprocessors in conjunction with a DSP core, or any other suchconfiguration. Although described herein primarily with respect todigital technology, a processor may also include primarily analogcomponents. A computing environment can include any type of computersystem, including, but not limited to, a computer system based on amicroprocessor, a mainframe computer, a digital signal processor, aportable computing device, a device controller, or a computationalengine within an appliance, to name a few.

Conditional language such as, among others, “can,” “could,” “might” or“may,” unless specifically stated otherwise, are otherwise understoodwithin the context as used in general to convey that certain embodimentsinclude, while other embodiments do not include, certain features,elements and/or steps. Thus, such conditional language is not generallyintended to imply that features, elements and/or steps are in any wayrequired for one or more embodiments or that one or more embodimentsnecessarily include logic for deciding, with or without user input orprompting, whether these features, elements and/or steps are included orare to be performed in any particular embodiment.

Disjunctive language such as the phrase “at least one of X, Y, or Z,”unless specifically stated otherwise, is otherwise understood with thecontext as used in general to present that an item, term, etc., may beeither X, Y, or Z, or any combination thereof (e.g., X, Y, and/or Z).Thus, such disjunctive language is not generally intended to, and shouldnot, imply that certain embodiments require at least one of X, at leastone of Y, or at least one of Z to each be present.

Any process descriptions, elements or blocks in the flow diagramsdescribed herein and/or depicted in the attached figures should beunderstood as potentially representing modules, segments, or portions ofcode which include one or more executable instructions for implementingspecific logical functions or elements in the process. Alternateimplementations are included within the scope of the embodimentsdescribed herein in which elements or functions may be deleted, executedout of order from that shown, or discussed, including substantiallyconcurrently or in reverse order, depending on the functionalityinvolved as would be understood by those skilled in the art.

Unless otherwise explicitly stated, articles such as “a” or “an” shouldgenerally be interpreted to include one or more described items.Accordingly, phrases such as “a device configured to” are intended toinclude one or more recited devices. Such one or more recited devicescan also be collectively configured to carry out the stated recitations.For example, “a processor configured to carry out recitations A, B andC” can include a first processor configured to carry out recitation Aworking in conjunction with a second processor configured to carry outrecitations B and C.

It should be emphasized that many variations and modifications may bemade to the above-described embodiments, the elements of which are to beunderstood as being among other acceptable examples. All suchmodifications and variations are intended to be included herein withinthe scope of this disclosure and protected by the following claims.

What is claimed is:
 1. A computing device comprising: a memory having afixed size for storing one or more processes utilized in the executionof a software application, wherein the memory comprises: a browserapplication having a set of linked processes that are dependent on abase process; and a low-memory manager; and a processor coupled to thememory and configured to execute processor-executable instructions toperform operations comprising: responsive to determining that thebrowser is transitioning to a background state, determining prioritiesfor each of the set of linked processes associated with the browserapplication, wherein each of the set of linked processes is associatedwith one of a low importance level, a standard importance level, and anelevated importance level; assigning a low importance level to a firstsubset of the set of linked processes associated with a low priority,wherein the low importance level is associated with processes that thelow-memory manager terminates before terminating processes associatedwith one of the standard importance level or the elevated importancelevel; assigning a standard importance level to a second subset of theset of linked processes associated with an intermediate priority,wherein the standard importance level is associated with processes thatthe low-memory manager terminates before terminating processesassociated with the elevated importance level; determining that thelow-memory manager of the computing device has terminated a process ofthe first subset operating in a background state by at least one ofdetecting a signal sent from the low-memory manager to the process toinitiate termination of the process or by periodically polling theprocesses in the first subset; modifying an importance level of aprocess of the second subset of the set of linked processes from thestandard importance level to the low importance level in response todetermining that the process of the first subset has been terminated;determining that a threshold amount of time has elapsed since a mostrecent process termination occurred; and modifying the importance levelof the process of the second subset from the low importance level to thestandard importance level in response to determining that the thresholdamount of time has elapsed.
 2. The computing device of claim 1, whereinthe processor is configured to execute processor-executable instructionsto perform operations further comprising: assigning an elevatedimportance level to a third subset of the set of linked processesassociated with a high priority, wherein the elevated importance levelis associated with processes that the low-memory manager terminatesafter terminating processes associated with one of the standardimportance level or the low importance level; and modifying animportance level of a process of the third subset from the elevatedimportance level to the standard importance level in response todetermining that the process of the first subset has been terminated. 3.The computing device of claim 2, wherein the processor is configured toexecute processor-executable instructions to perform operations furthercomprising: subsequent to modifying the importance level of the processof the second subset of the set: determining that the low-memory managerof the computing device has terminated the process of the second subsetof the set and another process of the second subset; and modifying animportance level of another process of the third subset from theelevated importance level to the low importance level in response todetermining that the low-memory manager has terminated the process ofthe second subset of the set and the other process of the second subset.4. A method for managing software applications on a computing device,the method comprising: determining priorities for each of a set oflinked processes for an application transitioning from a foregroundstate to a background state on the computing device; assigning a firstimportance level to a subset of the set of linked processes associatedwith a low priority, wherein a second process of the set of linkedprocesses is not included in the subset of linked processes and isassigned to a second importance level associated with a higher priorityrelative to the first importance level; determining that a first processin the subset of the set of linked processes has been terminated by atleast one of detecting a signal sent to the first process to initiatetermination of the first process or by periodically polling theprocesses in the subset; and modifying the importance level of thesecond process of the set of linked processes from the second importancelevel to the first importance level in response to determining that thefirst process has been terminated; determining that a threshold amountof time has elapsed since a most recent process termination occurred;and modifying the importance level of the second process from the firstimportance level to the second importance level in response todetermining that the threshold amount of time has elapsed.
 5. The methodof claim 4, further comprising determining a number of processes of theset of linked processes to assign to the first importance level,wherein: the determined number of processes are not assigned to thefirst importance level and not included in the subset of processes; andassigning the second process of the set of linked processes to the firstimportance level comprises assigning the determined number of processesof the set of linked processes to the first importance level.
 6. Themethod of claim 5, wherein determining a number of processes of the setof linked processes to assign to the first importance level comprises:obtaining an indirect measurement of memory available on the computingdevice; and determining the number of processes of the set of linkedprocesses to assign to the first importance level based at least in parton the indirect measurement of memory available on the computing device.7. The method of claim 6, wherein obtaining an indirect measurement ofmemory available on the computing device comprises determining a periodof time between two process terminations that have occurred mostrecently on the computing device.
 8. The method of claim 7, whereindetermining a number of processes of the set of linked to assign to thefirst importance level based at least in part on the indirectmeasurement of memory available on the computing device comprises:determining whether the period of time exceeds a termination timethreshold; determining a first number of processes in response todetermining that the period of time does not exceed the termination timethreshold; and determining a second number of processes in response todetermining that the period of time exceeds the termination timethreshold, wherein the second number of processes is at least equal tothe first number of processes.
 9. The method of claim 6, whereinobtaining an indirect measurement of memory available on the computingdevice comprises determining an input-output latency of the computingdevice.
 10. The method of claim 9, wherein determining a number ofprocesses of the set of linked processes to assign to the firstimportance level based at least in part on the indirect measurement ofmemory available on the computing device comprises: determining whetherthe input-output latency exceeds a latency threshold; determining afirst number of processes in response to determining that theinput-output latency does not exceed the latency threshold; anddetermining a second number of processes in response to determining thatthe input-output latency exceeds the latency threshold, wherein thesecond number of processes is at least equal to the first number ofprocesses.
 11. The method of claim 6, wherein obtaining an indirectmeasurement of memory available on the computing device comprisesdetermining a processing delay of the computing device.
 12. The methodof claim 11, wherein determining a number of processes to assign to thefirst importance level based at least in part on the indirectmeasurement of memory available on the computing device comprises:determining whether the processing delay exceeds a processing delaythreshold; determining a first number of processes in response todetermining that the processing delay does not exceed the processingdelay threshold; and determining a second number of processes inresponse to determining that the processing delay exceeds the processingdelay threshold, wherein the second number of processes is at leastequal to the first number of processes.
 13. A non-transitory,computer-readable medium having stored thereon computer-executablesoftware instructions configured to cause a processor of a computingdevice to perform operations comprising: determining a priority orderfor each of a set of linked processes associated with an applicationtransitioning from a foreground state to a background state on thecomputing device; assigning one of a first importance level or a secondimportance level to each of the set of linked processes based at leastin part on the determined priority order, wherein the second importancelevel is associated with a higher priority relative to the firstimportance level; determining that at least one process associated withthe first importance level is associated with a termination eventcorresponding to at least one of a detected signal sent to the at leastone process to initiate the termination event or polling the processesassociated with the first importance level; reducing an importance levelof at least a second process associated with the second importance levelfrom the second importance level to the first importance level;determining that a threshold amount of time has elapsed since a mostrecent termination event occurred; and increasing the importance levelof the second process from the first importance level to the secondimportance level in response to determining that the threshold amount oftime has elapsed.
 14. The non-transitory, computer-readable medium ofclaim 13, wherein the stored computer-executable software instructionsare configured to cause a processor of the computing device to performoperations such that: the first importance level is a low importancelevel; the second importance level is a standard importance level; andprocesses assigned to the first importance level are terminated beforeprocesses assigned to the second importance level.
 15. Thenon-transitory, computer-readable medium of claim 13, wherein the storedcomputer-executable software instructions are configured to cause aprocessor of the computing device to perform operations such thatreducing an importance level of at least one of the set of linkedprocesses comprises reassigning an importance level of a first processof the set of linked processes from the second importance level to thefirst importance level.
 16. The non-transitory, computer-readable mediumof claim 15 wherein the stored computer-executable software instructionsare configured to cause a processor of the computing device to performoperations further comprising reassigning an importance level of asecond process of the set of linked processes from a third importancelevel to the second importance level.
 17. The non-transitory,computer-readable medium of claim 13, wherein the storedcomputer-executable software instructions are configured to cause aprocessor of the computing device to perform operations such that: thefirst importance level is a low importance level; the second importancelevel is a standard importance level; the third importance level is anelevated importance level; processes assigned to the first importancelevel are terminated before processes assigned to the second importancelevel; and processes assigned to the second importance level areterminated before processes assigned to the third importance level. 18.The non-transitory, computer-readable medium of claim 13, wherein thestored computer-executable software instructions are configured to causea processor of the computing device to perform operations such thatdetermining that at least one process associated with the firstimportance level is associated with a termination comprises determiningthat at least one process associated with the first importance level isassociated with a termination and that at least one process associatedwith the second importance level is associated with a termination. 19.The non-transitory, computer-readable medium of claim 18, wherein thestored computer-executable software instructions are configured to causea processor of the computing device to perform operations furthercomprising reassigning an importance level of at least one process ofthe set of linked processes from a third importance level to the firstimportance level.
 20. The non-transitory, computer-readable medium ofclaim 13, wherein reducing an importance level of at least one of theset of linked processes comprises: obtaining an indirect measurement ofmemory available on the computing device; determining a number ofprocesses in the set of linked processes based at least in part on theindirect measurement of memory available on the computing device; andreducing an importance level for each of the determined number ofprocesses of the set of linked processes to the first importance level.21. The non-transitory, computer-readable medium of claim 20, whereinthe stored computer-executable software instructions are configured tocause a processor of the computing device to perform operations suchthat the indirect measurement of memory available on the computingdevice comprises at least one of an input-output latency of thecomputing device and a processing delay of the computing device.
 22. Thenon-transitory, computer-readable medium of claim 13, wherein the storedcomputer-executable software instructions are configured to cause aprocessor of the computing device to perform operations such that:determining a priority order for each of a set of linked processescomprises determining a respective cost associated with restarting eachof the set of linked processes, wherein a first process associated witha lower cost has a lower priority than a priority associated with asecond process associated with a higher cost; and assigning animportance level to each of the set of linked processes based at leastin part on the determined priority order comprises assigning importancelevels to the set of linked processes such that the first process isassociated with an importance level that does not exceed an importancelevel of the second process.
 23. The non-transitory, computer-readablemedium of claim 22, wherein the stored computer-executable softwareinstructions are configured to cause a processor of the computing deviceto perform operations such that a cost of restarting a process comprisesat least one of an amount of battery power required to restart theprocess, an amount of processing resources required to restart theprocess, or a period of time required to restart the process.
 24. Thenon-transitory, computer-readable medium of claim 13, wherein the storedcomputer-executable software instructions are configured to cause aprocessor of the computing device to perform operations furthercomprising: storing state information for a process associated with athird importance level in response to determining that at least oneprocess associated with the first importance level is associated with atermination; and reassigning an importance level of the processassociated with the third importance level from the third importancelevel to the first importance level.
 25. The non-transitory,computer-readable medium of claim 24, wherein the storedcomputer-executable software instructions are configured to cause aprocessor of the computing device to perform operations such that thestate information comprises at least one of user form input or browserapplication state information.